@travetto/cli 3.3.0 → 3.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -77,7 +77,7 @@ export class BasicCommand {
77
77
  ```bash
78
78
  $ trv basic -h
79
79
 
80
- Usage: doc/cli.basic [options]
80
+ Usage: basic [options]
81
81
 
82
82
  Options:
83
83
  -h, --help display help for command
@@ -114,7 +114,7 @@ export class BasicCommand {
114
114
  ```bash
115
115
  $ trv basic:flag -h
116
116
 
117
- Usage: doc/cli.basic:flag [options]
117
+ Usage: basic:flag [options]
118
118
 
119
119
  Options:
120
120
  -l, --loud
@@ -159,7 +159,7 @@ export class BasicCommand {
159
159
  ```bash
160
160
  $ trv basic:arg -h
161
161
 
162
- Usage: doc/cli.basic:arg [options] [volume:number]
162
+ Usage: basic:arg [options] [volume:number]
163
163
 
164
164
  Options:
165
165
  -h, --help display help for command
@@ -172,7 +172,7 @@ $ trv basic:arg 20
172
172
  Execution failed:
173
173
  * Argument is bigger than (10)
174
174
 
175
- Usage: doc/cli.basic:arg [options] [volume:number]
175
+ Usage: basic:arg [options] [volume:number]
176
176
 
177
177
  Options:
178
178
  -h, --help display help for command
@@ -214,7 +214,7 @@ export class BasicCommand {
214
214
  ```bash
215
215
  $ trv basic:arglist -h
216
216
 
217
- Usage: doc/cli.basic:arglist [options] <volumes...:number>
217
+ Usage: basic:arglist [options] <volumes...:number>
218
218
 
219
219
  Options:
220
220
  -r, --reverse
@@ -235,7 +235,7 @@ $ trv basic:arglist 10 5 3 9 20 1
235
235
  Execution failed:
236
236
  * Argument [4] is bigger than (10)
237
237
 
238
- Usage: doc/cli.basic:arglist [options] <volumes...:number>
238
+ Usage: basic:arglist [options] <volumes...:number>
239
239
 
240
240
  Options:
241
241
  -r, --reverse
@@ -280,7 +280,7 @@ export class CustomCommand {
280
280
  ```bash
281
281
  $ trv custom:arg -h
282
282
 
283
- Usage: doc/cli.custom:arg [options] [volume:number]
283
+ Usage: custom:arg [options] [volume:number]
284
284
 
285
285
  Options:
286
286
  -m, --message <string> The message to send back to the user (default: "hello")
@@ -331,7 +331,7 @@ export class CustomCommand {
331
331
  ```bash
332
332
  $ trv custom:env-arg -h
333
333
 
334
- Usage: doc/cli.custom:env-arg [options] [volume:number]
334
+ Usage: custom:env-arg [options] [volume:number]
335
335
 
336
336
  Options:
337
337
  -t, --text <string> The message to send back to the user (default: "hello")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/cli",
3
- "version": "3.3.0",
3
+ "version": "3.3.1",
4
4
  "description": "CLI infrastructure for Travetto framework",
5
5
  "keywords": [
6
6
  "cli",
package/src/decorators.ts CHANGED
@@ -9,7 +9,7 @@ import { CliUtil } from './util';
9
9
 
10
10
  type ExtraFields = 'module' | 'profile' | 'env';
11
11
 
12
- const getName = (source: string): string => source.match(/cli.(.*)[.]tsx?$/)![1].replaceAll('_', ':');
12
+ const getName = (source: string): string => (source.match(/cli[.](.*)[.]tsx?$/)?.[1] ?? source).replaceAll('_', ':');
13
13
  const getMod = (cls: Class): string => RootIndex.getModuleFromSource(RootIndex.getFunctionMetadata(cls)!.source)!.name;
14
14
 
15
15
  /**