@handy-common-utils/oclif-utils
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -5,3 +5,4 @@ import { Command, Interfaces } from '@oclif/core'; | ||
/** | ||
* Use this function to prepend command line to examples. | ||
* Use this function to prepend command line to examples, | ||
* so that we don't have to hard code command name in the examples. | ||
* This function needs to be called from `init()` function of the Command. | ||
@@ -8,0 +9,0 @@ * @param commandInstance instance of the Command |
@@ -33,3 +33,4 @@ "use strict"; | ||
/** | ||
* Use this function to prepend command line to examples. | ||
* Use this function to prepend command line to examples, | ||
* so that we don't have to hard code command name in the examples. | ||
* This function needs to be called from `init()` function of the Command. | ||
@@ -41,3 +42,3 @@ * @param commandInstance instance of the Command | ||
const cmd = commandInstance.ctor; | ||
if (Array.isArray(cmd.examples)) { // so that we don't have to hard code command name in the examples | ||
if (Array.isArray(cmd.examples)) { | ||
const prepend = (s) => (s && s.startsWith('^ ')) ? s.replace('^', commandInstance.config.bin) : s; | ||
@@ -44,0 +45,0 @@ // eslint-disable-next-line unicorn/no-array-for-each |
{ | ||
"name": "@handy-common-utils/oclif-utils", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "oclif related utilities", | ||
@@ -24,3 +24,3 @@ "scripts": { | ||
"@handy-common-utils/dev-dependencies": "^1.1.1", | ||
"@oclif/core": "^1.6.1", | ||
"@oclif/core": "^1.6.4", | ||
"@types/fs-extra": "^8.1.1" | ||
@@ -27,0 +27,0 @@ }, |
@@ -45,3 +45,3 @@ # @handy-common-utils/oclif-utils | ||
class AwsServerlessDataflow extends Command { | ||
// You can use "typeof AwsServerlessDataflow.Options" in other places to refer to the type | ||
// You can use "typeof AwsServerlessDataflow.Options" in other places to refer to the type, if you want this convenience | ||
static Options: CommandOptions<typeof AwsServerlessDataflow> | ||
@@ -53,3 +53,6 @@ | ||
version: Flags.version({ char: 'v' }), | ||
help: Flags.help({ char: 'h' }), | ||
help: { ...Flags.help({ char: 'h' }), parse: async (_: any, cmd: Command) => { | ||
cmd.log(await OclifUtils.generateHelpText(cmd)); | ||
cmd.exit(0); | ||
} }, | ||
'update-readme.md': flags.boolean({ hidden: true, description: 'For developers only, don\'t use' }), | ||
@@ -316,3 +319,4 @@ debug: Flags.boolean({ char: 'd', name: 'debug' }), | ||
Use this function to prepend command line to examples. | ||
Use this function to prepend command line to examples, | ||
so that we don't have to hard code command name in the examples. | ||
This function needs to be called from `init()` function of the Command. | ||
@@ -319,0 +323,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
56361
372
551