talented-args 0.3.4-beta → 0.4.1-beta
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 +130 -58
- package/dist/compile.d.ts +2 -0
- package/dist/compile.js +15 -1
- package/dist/compile.js.map +1 -1
- package/dist/descriptors.d.ts +20 -0
- package/dist/descriptors.js +25 -1
- package/dist/descriptors.js.map +1 -1
- package/dist/display.d.ts +24 -3
- package/dist/display.js +190 -98
- package/dist/display.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/options.d.ts +9 -0
- package/dist/options.js +16 -2
- package/dist/options.js.map +1 -1
- package/dist/parse.d.ts +1 -1
- package/dist/parse.js +89 -8
- package/dist/parse.js.map +1 -1
- package/dist/program.d.ts +20 -0
- package/dist/program.js +45 -0
- package/dist/program.js.map +1 -1
- package/dist/sections.d.ts +91 -0
- package/dist/sections.js +103 -0
- package/dist/sections.js.map +1 -0
- package/dist/tui.d.ts +3 -0
- package/dist/tui.js +1 -0
- package/dist/tui.js.map +1 -1
- package/dist/tui_layout.d.ts +6 -0
- package/dist/tui_layout.js +92 -11
- package/dist/tui_layout.js.map +1 -1
- package/dist/tui_model.d.ts +8 -1
- package/dist/tui_model.js +37 -13
- package/dist/tui_model.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -26,6 +26,7 @@ npm install talented-args
|
|
|
26
26
|
Source code: [demo/index.ts](demo/index.ts)
|
|
27
27
|
|
|
28
28
|
To try it out:
|
|
29
|
+
|
|
29
30
|
- `npm run demo` - run stock demo, TUI mode
|
|
30
31
|
- `npm run demo -- -h` - show the help screen
|
|
31
32
|
- `npm run demo -- backup --help` - show command-specific help
|
|
@@ -74,6 +75,7 @@ void main().catch(error => {
|
|
|
74
75
|
```
|
|
75
76
|
|
|
76
77
|
What did we do here:
|
|
78
|
+
|
|
77
79
|
1. Define a program with `talentedArgs(options, define)`.
|
|
78
80
|
2. `define` is a callback you use to define your commands, flags, and args.
|
|
79
81
|
3. Call `program.parseOrDie()`. This might trigger the TUI mode if nothing is provided (that's why async), or print help and exit.
|
|
@@ -91,6 +93,7 @@ What did we do here:
|
|
|
91
93
|
- [Interactive mode](#interactive-mode)
|
|
92
94
|
- [Remember interactive values](#remember-interactive-values)
|
|
93
95
|
- [Program options and help](#program-options-and-help)
|
|
96
|
+
- [Customize program](#customize-program)
|
|
94
97
|
- [TypeScript types](#typescript-types)
|
|
95
98
|
|
|
96
99
|
#### Define options
|
|
@@ -113,21 +116,23 @@ program.parse(['--name', 'Alice']);
|
|
|
113
116
|
| `ta.arg(names, description)` | A string, such as `"8080"` | Property is absent |
|
|
114
117
|
| `ta.arg(names, description, convert)` | The converter's return value | Property is absent |
|
|
115
118
|
| `ta.flag(names, description)` | `true`; flags take no value | Property is absent |
|
|
119
|
+
| `ta.rest(names, description)` | Everything after the command | Property is absent |
|
|
116
120
|
|
|
117
121
|
Give `names` one spelling, like `'--port'`, or a non-empty array, like `['-p', '--port']`. Long names start with `--`; short aliases are one character after `-` and can't be digits. Names are case-sensitive, and spaces or `=` aren't allowed. You have to pass a description, but an empty string is fine.
|
|
118
122
|
|
|
119
123
|
These methods return new descriptors, so they don't change the original. Keep the version they return:
|
|
120
124
|
|
|
121
|
-
| Method | Applies to | Effect
|
|
122
|
-
| -------------------- | ------------------------ |
|
|
123
|
-
| `.required()` | Values and lists | The user has to give a value, or at least one list item
|
|
124
|
-
| `.default(value)` | Values, lists, and flags | Use this value when the option is left out
|
|
125
|
-
| `.
|
|
126
|
-
| `.
|
|
127
|
-
| `.
|
|
128
|
-
| `.
|
|
129
|
-
| `.
|
|
130
|
-
| `.
|
|
125
|
+
| Method | Applies to | Effect |
|
|
126
|
+
| -------------------- | ------------------------ | -------------------------------------------------------------------------------- |
|
|
127
|
+
| `.required()` | Values and lists | The user has to give a value, or at least one list item |
|
|
128
|
+
| `.default(value)` | Values, lists, and flags | Use this value when the option is left out |
|
|
129
|
+
| `.preset(value)` | Values | Allow you to define `--option` without a value (the preset value will be filled) |
|
|
130
|
+
| `.label('TCP_PORT')` | Values and lists | Show a custom value label in help |
|
|
131
|
+
| `.multiple()` | Values | Take several values and give you an array |
|
|
132
|
+
| `.positional()` | Values and lists | Also take values without the option name |
|
|
133
|
+
| `.sensitive()` | Values and lists | Hide values on screen and in errors, and don't save them |
|
|
134
|
+
| `.transient()` | Values, lists, and flags | Never save the value, and ignore any saved value for it next time |
|
|
135
|
+
| `.negatable()` | Flags with a long name | Also take `--no-<name>`, which sets the flag to `false` |
|
|
131
136
|
|
|
132
137
|
Defaults don't go through the converter, so a number needs a numeric default, like `.default(8080)`. Calling `.required()` drops any previous default, and `.default()` replaces a previous requirement. If you want a list, call `.multiple()` before either of them.
|
|
133
138
|
|
|
@@ -241,10 +246,10 @@ Do things like `.multiple()`, `.positional()`, `.label()`, `.sensitive()`, `.tra
|
|
|
241
246
|
|
|
242
247
|
Put `ta.meta()` wherever you'd like the result to tell you which command ran and whether the user went through the editor. It adds `{ command, interactive }` without adding another command line option.
|
|
243
248
|
|
|
244
|
-
| Property | Meaning
|
|
245
|
-
| ------------- |
|
|
246
|
-
| `command` | The command name, or `null` if no command was picked
|
|
247
|
-
| `interactive` | `true` if the user went through the editor, otherwise `false`
|
|
249
|
+
| Property | Meaning |
|
|
250
|
+
| ------------- | ------------------------------------------------------------- |
|
|
251
|
+
| `command` | The command name, or `null` if no command was picked |
|
|
252
|
+
| `interactive` | `true` if the user went through the editor, otherwise `false` |
|
|
248
253
|
|
|
249
254
|
```typescript
|
|
250
255
|
const program = talentedArgs({ name: 'My app', missingCommandPolicy: 'none' }, ta => ({
|
|
@@ -277,12 +282,12 @@ void main().catch(error => {
|
|
|
277
282
|
|
|
278
283
|
If all goes well, you get your object back. It also takes care of help, bad arguments, and the editor:
|
|
279
284
|
|
|
280
|
-
| Situation | Behavior
|
|
281
|
-
| ----------------------------------------- |
|
|
282
|
-
| `-h` or `--help` | Print help to stdout
|
|
283
|
-
| Invalid input or a missing required value | Explain what's wrong on stderr
|
|
284
|
-
| Interactive mode cancelled | Put the terminal back as it was and exit
|
|
285
|
-
| Command copied from the editor | Print the masked command to stdout and try to copy it
|
|
285
|
+
| Situation | Behavior | Exit code |
|
|
286
|
+
| ----------------------------------------- | ----------------------------------------------------- | --------- |
|
|
287
|
+
| `-h` or `--help` | Print help to stdout | `0` |
|
|
288
|
+
| Invalid input or a missing required value | Explain what's wrong on stderr | `1` |
|
|
289
|
+
| Interactive mode cancelled | Put the terminal back as it was and exit | `130` |
|
|
290
|
+
| Command copied from the editor | Print the masked command to stdout and try to copy it | `0` |
|
|
286
291
|
|
|
287
292
|
You can also import these codes as `TALENTED_ARGS_EXIT_CODES`. Its keys are `help`, `usage`, `cancelled`, and `copied`.
|
|
288
293
|
|
|
@@ -295,11 +300,11 @@ if (result.kind === 'parsed') {
|
|
|
295
300
|
}
|
|
296
301
|
```
|
|
297
302
|
|
|
298
|
-
| `result.kind` | Result
|
|
299
|
-
| ----------------- |
|
|
303
|
+
| `result.kind` | Result |
|
|
304
|
+
| ----------------- | ---------------------------------------------------------------- |
|
|
300
305
|
| `'parsed'` | `{ kind, args, command }`, with the values converted and checked |
|
|
301
|
-
| `'help'` | `{ kind, command }`, saying which help page to show
|
|
302
|
-
| `'needs-command'` | `{ kind }`, when the user needs to pick a command
|
|
306
|
+
| `'help'` | `{ kind, command }`, saying which help page to show |
|
|
307
|
+
| `'needs-command'` | `{ kind }`, when the user needs to pick a command |
|
|
303
308
|
| `'interactive'` | `{ kind, command }`, when the user asked for `--interactive` |
|
|
304
309
|
|
|
305
310
|
`parse()` throws `TalentedArgsUsageError` if something's wrong. Help wins over other usage errors. With `--interactive`, values don't get converted or checked for missing requirements yet, since the user can fix them in the editor. The command line still has to make sense, though.
|
|
@@ -318,28 +323,28 @@ If your program has commands and the user doesn't pick one, the editor opens. Th
|
|
|
318
323
|
|
|
319
324
|
You can change that with `missingCommandPolicy`:
|
|
320
325
|
|
|
321
|
-
| Policy | `parseOrDie()` behavior
|
|
322
|
-
| -------------------- |
|
|
323
|
-
| `'tui'`, the default | Open the editor. If there's no suitable terminal, show help and exit with code 1 | `'needs-command'`
|
|
324
|
-
| `'error'` | Print help and exit with code 1
|
|
325
|
-
| `'none'` | Return the common arguments, with no command property
|
|
326
|
+
| Policy | `parseOrDie()` behavior | `parse()` result |
|
|
327
|
+
| -------------------- | -------------------------------------------------------------------------------- | -------------------------------- |
|
|
328
|
+
| `'tui'`, the default | Open the editor. If there's no suitable terminal, show help and exit with code 1 | `'needs-command'` |
|
|
329
|
+
| `'error'` | Print help and exit with code 1 | `'needs-command'` |
|
|
330
|
+
| `'none'` | Return the common arguments, with no command property | `'parsed'`, with `command: null` |
|
|
326
331
|
|
|
327
332
|
`'none'` also puts a no-command choice in the editor. `ta.meta()` tells you if that's what the user picked. These policies only matter when your program has commands. The user can still ask for `--interactive` with any of them.
|
|
328
333
|
|
|
329
334
|
The editor needs a terminal for input and output, and `TERM` has to be set to something other than `dumb`. Setting `CI` disables it, unless its value is `''`, `'0'`, or `'false'`. If stdout is piped somewhere but stderr is a terminal, we draw on stderr. Asking for `--interactive` when there's no suitable terminal gives a usage error.
|
|
330
335
|
|
|
331
|
-
| Key | Action
|
|
332
|
-
| ----------------------- |
|
|
333
|
-
| Up / Down | Move through commands or fields
|
|
334
|
-
| Enter | Open a command, go to the next field, or press the selected button
|
|
335
|
-
| Tab / Shift-Tab | Switch between commands, fields, and buttons
|
|
336
|
-
| Space on a flag | Toggle it; negatable flags cycle through unset, `true`, and `false`
|
|
337
|
-
| Ctrl-U in a text field | Clear the field
|
|
338
|
-
| Left / Right on buttons | Choose Run, Copy, or Cancel
|
|
339
|
-
| Ctrl-R | Check the values and run
|
|
340
|
-
| Ctrl-Y | Check the values and copy, then exit without running
|
|
341
|
-
| Escape | Return to command selection, or cancel from there
|
|
342
|
-
| Ctrl-C | Cancel
|
|
336
|
+
| Key | Action |
|
|
337
|
+
| ----------------------- | ------------------------------------------------------------------- |
|
|
338
|
+
| Up / Down | Move through commands or fields |
|
|
339
|
+
| Enter | Open a command, go to the next field, or press the selected button |
|
|
340
|
+
| Tab / Shift-Tab | Switch between commands, fields, and buttons |
|
|
341
|
+
| Space on a flag | Toggle it; negatable flags cycle through unset, `true`, and `false` |
|
|
342
|
+
| Ctrl-U in a text field | Clear the field |
|
|
343
|
+
| Left / Right on buttons | Choose Run, Copy, or Cancel |
|
|
344
|
+
| Ctrl-R | Check the values and run |
|
|
345
|
+
| Ctrl-Y | Check the values and copy, then exit without running |
|
|
346
|
+
| Escape | Return to command selection, or cancel from there |
|
|
347
|
+
| Ctrl-C | Cancel |
|
|
343
348
|
|
|
344
349
|
Leave a text field blank to leave the option out. Type `""` if you actually want an empty string. A single-value field strips one pair of quotes around the whole value. In a list field, separate items with spaces. Single or double quotes and backslash escapes work there too.
|
|
345
350
|
|
|
@@ -357,12 +362,12 @@ const program = talentedArgs({ name: 'My app', remember: true }, ta => ({
|
|
|
357
362
|
}));
|
|
358
363
|
```
|
|
359
364
|
|
|
360
|
-
| `remember` | Storage
|
|
361
|
-
| ---------------------- |
|
|
362
|
-
| `true` | Default system state file
|
|
363
|
-
| `'/path/to/file.json'` | Your file. Relative paths start at the working directory.
|
|
364
|
-
| `{ load, save }` | Your own storage methods. You can leave out `save`.
|
|
365
|
-
| `false` or omitted | Don't remember anything
|
|
365
|
+
| `remember` | Storage |
|
|
366
|
+
| ---------------------- | --------------------------------------------------------- |
|
|
367
|
+
| `true` | Default system state file |
|
|
368
|
+
| `'/path/to/file.json'` | Your file. Relative paths start at the working directory. |
|
|
369
|
+
| `{ load, save }` | Your own storage methods. You can leave out `save`. |
|
|
370
|
+
| `false` or omitted | Don't remember anything |
|
|
366
371
|
|
|
367
372
|
Default file locations are:
|
|
368
373
|
|
|
@@ -412,17 +417,18 @@ You can store strings, numbers, booleans, or arrays of strings and numbers. We s
|
|
|
412
417
|
|
|
413
418
|
These go in the first argument to `talentedArgs()`:
|
|
414
419
|
|
|
415
|
-
| Option | What it does
|
|
416
|
-
| ---------------------- |
|
|
417
|
-
| `name` | Name shown in help and the editor
|
|
418
|
-
| `description` | Program description
|
|
419
|
-
| `version` | Version shown in help
|
|
420
|
-
| `executable` | How to start the app, shown in help and previews
|
|
421
|
-
| `logo` | ASCII or Unicode logo text, as a multiline string
|
|
422
|
-
| `logoPath` | UTF-8 text file containing an ASCII or Unicode logo
|
|
423
|
-
| `
|
|
424
|
-
| `
|
|
425
|
-
| `
|
|
420
|
+
| Option | What it does | Default |
|
|
421
|
+
| ---------------------- | ------------------------------------------------------- | ---------------------------------------------- |
|
|
422
|
+
| `name` | Name shown in help and the editor | Application package name |
|
|
423
|
+
| `description` | Program description | Application package description |
|
|
424
|
+
| `version` | Version shown in help | Application package version, prefixed with `v` |
|
|
425
|
+
| `executable` | How to start the app, shown in help and previews | Application script filename |
|
|
426
|
+
| `logo` | ASCII or Unicode logo text, as a multiline string | Load from `logoPath` if provided |
|
|
427
|
+
| `logoPath` | UTF-8 text file containing an ASCII or Unicode logo | No logo |
|
|
428
|
+
| `logoPosition` | Where to put the logo: `'right'`, `'top'` or `'bottom'` | `'right'` |
|
|
429
|
+
| `styles` | Colors and other text styles | Built-in styles |
|
|
430
|
+
| `missingCommandPolicy` | What to do when there are commands but none was picked | `'tui'` |
|
|
431
|
+
| `remember` | Where the editor keeps previous values | `false` |
|
|
426
432
|
|
|
427
433
|
We look for the nearest readable `package.json` above your app's script. That's where the name, description, and version come from unless you give them yourself. A version you pass in is shown exactly as you wrote it.
|
|
428
434
|
|
|
@@ -458,6 +464,62 @@ You can use the usual colors, bright versions like `cyanBright`, backgrounds lik
|
|
|
458
464
|
|
|
459
465
|
Help uses terminal colors when it can. A non-empty `NO_COLOR` turns them off; otherwise, `FORCE_COLOR` can turn them on. Piped output is normally plain text. The editor still uses its terminal controls regardless of these color settings.
|
|
460
466
|
|
|
467
|
+
#### Customize program
|
|
468
|
+
|
|
469
|
+
`program.customize(customization)` allows you to customize the appearance of your program.
|
|
470
|
+
|
|
471
|
+
##### `customization.formatSection(content, context)`
|
|
472
|
+
|
|
473
|
+
Customize various sections of the help and of interactive mode before they are shown:
|
|
474
|
+
|
|
475
|
+
```typescript
|
|
476
|
+
import { formatters, talentedArgs } from 'talented-args';
|
|
477
|
+
|
|
478
|
+
const program = talentedArgs({ name: 'My app' }, ta => ({
|
|
479
|
+
server: ta.command('serve', 'Start the server', { port: ta.arg('--port', 'Port', Number) }),
|
|
480
|
+
})).customize({
|
|
481
|
+
formatSection: (content, { type, command, interactive }) => {
|
|
482
|
+
if (type === 'footer' && command === 'serve') {
|
|
483
|
+
content.push(
|
|
484
|
+
formatters.title('Examples'),
|
|
485
|
+
formatters.row('my-app serve --port 80', 'Serve on port 80'),
|
|
486
|
+
formatters.row('my-app serve', 'Serve on a port picked by the system')
|
|
487
|
+
);
|
|
488
|
+
}
|
|
489
|
+
},
|
|
490
|
+
});
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
`content` is the default content for that section. `context` is an object in the shape `{ type, command, interactive }`.
|
|
494
|
+
|
|
495
|
+
`command` is the command the user has invoked, or `null` if none. `interactive` is true if we're running in TUI mode.
|
|
496
|
+
|
|
497
|
+
`type` is the section type you're customizing. These are the sections, in the order they're shown (note: the interactive mode doesn't get all sections):
|
|
498
|
+
|
|
499
|
+
| `type` | Where | Default value |
|
|
500
|
+
| ----------------- | --------------------------- | ------------------------------------------------------ |
|
|
501
|
+
| `header` | Help and interactive mode | The banner |
|
|
502
|
+
| `command` | Command help | The command name and details |
|
|
503
|
+
| `usage` | Help | How to run the program or the command |
|
|
504
|
+
| `commands` | Program help, with commands | The command list |
|
|
505
|
+
| `command_options` | Command help | The command's own options, or nothing if it has none |
|
|
506
|
+
| `common_options` | Help | Options outside of commands, and the built-in ones |
|
|
507
|
+
| `footer` | Help and interactive mode | Nothing. In interactive mode, it goes under the editor |
|
|
508
|
+
|
|
509
|
+
Your hook should return a new or updated array of `ISectionContent`, or an empty array to leave the section out, or undefined/void to keep the default.
|
|
510
|
+
|
|
511
|
+
What can you put in a section?
|
|
512
|
+
|
|
513
|
+
| What to put | What it means |
|
|
514
|
+
| ----------------------------------- | ------------------------------------------------------------- |
|
|
515
|
+
| A string | Raw text, without any processing. `''` means a blank line |
|
|
516
|
+
| `formatters.text(text)` | Indented text, with some processing (eg. line wrapping) |
|
|
517
|
+
| `formatters.title(text)` | A heading, like `Usage` |
|
|
518
|
+
| `formatters.row(name, description)` | A two-column row. Rows next to each other share their columns |
|
|
519
|
+
| `formatters.banner()` | The program name, description, version and logo |
|
|
520
|
+
|
|
521
|
+
As you can see, you can use `formatters` to create some content blocks in the talented-args style.
|
|
522
|
+
|
|
461
523
|
#### TypeScript types
|
|
462
524
|
|
|
463
525
|
The types come from what you defined. `.required()` and `.default()` make an argument property non-optional. Other arguments and command properties are optional. Groups and metadata are always there when the part of the result containing them is there.
|
|
@@ -495,6 +557,16 @@ The guide checks that you defined every property, even the optional ones. You ca
|
|
|
495
557
|
|
|
496
558
|
### Release log
|
|
497
559
|
|
|
560
|
+
#### 0.4.1-beta
|
|
561
|
+
|
|
562
|
+
- Add `logoPosition`, to show the logo above or below the banner text instead of on the right.
|
|
563
|
+
|
|
564
|
+
#### 0.4.0-beta
|
|
565
|
+
|
|
566
|
+
- Add `ta.rest()` for commands that pass everything after their name on to another program.
|
|
567
|
+
- Add `.preset()` for options whose value can be left out.
|
|
568
|
+
- Add `program.customize({ formatSection })` and `formatters`, to change or add to any section of the help, and the header and footer of interactive mode.
|
|
569
|
+
|
|
498
570
|
#### 0.3.4-beta
|
|
499
571
|
|
|
500
572
|
- Add `.transient()` to keep an argument out of saved interactive values without masking it.
|
package/dist/compile.d.ts
CHANGED
|
@@ -42,6 +42,8 @@ export interface ICompiledCommand {
|
|
|
42
42
|
readonly details: string;
|
|
43
43
|
readonly scope: IScope;
|
|
44
44
|
readonly active: IActiveScope;
|
|
45
|
+
/** Input that takes everything after the command token, or `null` if the command parses its arguments. */
|
|
46
|
+
readonly rest: IInputSpec | null;
|
|
45
47
|
}
|
|
46
48
|
export interface ICompiledSchema {
|
|
47
49
|
readonly root: IScope;
|
package/dist/compile.js
CHANGED
|
@@ -145,6 +145,10 @@ function compileSchema(shape, options) {
|
|
|
145
145
|
const commandDrafts = [];
|
|
146
146
|
walkShape(shape, [], '', rootDraft, commandDrafts, [shape]);
|
|
147
147
|
const root = finishScope(rootDraft);
|
|
148
|
+
const rootRest = root.inputs.find(input => input.rest);
|
|
149
|
+
if (rootRest) {
|
|
150
|
+
throw new errors_1.DefinitionError(`${(0, descriptors_1.inputDisplayName)(rootRest)} is a ta.rest(), which takes what comes after a command name. Place it in a command`);
|
|
151
|
+
}
|
|
148
152
|
const rootActive = buildActiveScope(root, null, 'outside of commands');
|
|
149
153
|
const commands = [];
|
|
150
154
|
const commandsByToken = new Map();
|
|
@@ -157,13 +161,23 @@ function compileSchema(shape, options) {
|
|
|
157
161
|
const scopeDraft = { placements: [], groups: [], metas: [] };
|
|
158
162
|
walkShape(draft.shape, [], where, scopeDraft, null, [draft.shape]);
|
|
159
163
|
const scope = finishScope(scopeDraft);
|
|
164
|
+
const active = buildActiveScope(root, scope, `for command "${draft.token}"`);
|
|
165
|
+
const rest = active.positional?.rest ? active.positional : null;
|
|
166
|
+
// Everything after the command token goes to the rest input, so options of the command
|
|
167
|
+
// itself could never be given. Shared common options still work before the command.
|
|
168
|
+
const unreachable = scope.inputs.filter(input => input !== rest && !root.inputs.includes(input));
|
|
169
|
+
if (rest && unreachable.length) {
|
|
170
|
+
throw new errors_1.DefinitionError(`command "${draft.token}" takes everything after its name with ta.rest(), ` +
|
|
171
|
+
`so it can't have options of its own: ${(0, tools_1.quoteList)(unreachable.map(descriptors_1.inputDisplayName))}`);
|
|
172
|
+
}
|
|
160
173
|
const command = {
|
|
161
174
|
key: draft.key,
|
|
162
175
|
token: draft.token,
|
|
163
176
|
summary: draft.summary,
|
|
164
177
|
details: draft.details,
|
|
165
178
|
scope,
|
|
166
|
-
active
|
|
179
|
+
active,
|
|
180
|
+
rest,
|
|
167
181
|
};
|
|
168
182
|
commands.push(command);
|
|
169
183
|
commandsByToken.set(command.token, command);
|
package/dist/compile.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile.js","sourceRoot":"","sources":["../src/compile.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"compile.js","sourceRoot":"","sources":["../src/compile.ts"],"names":[],"mappings":";;AAoFA,sCAKC;AAuLD,sCAoEC;AAaD,kCAgBC;AAjXD,+CAOuB;AACvB,qCAA2C;AAE3C,mCAAmD;AA0EnD,SAAgB,aAAa,CAC3B,MAAuB,EACvB,OAAgC;IAEhC,OAAO,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC;AACtD,CAAC;AAED,wHAAwH;AAExH;;;;GAIG;AACH,SAAS,WAAW,CAAC,GAAW;IAC9B,OAAO,CAAC,CAAC,GAAG,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,KAAK,WAAW,CAAC;AAC3D,CAAC;AAED,SAAS,YAAY,CAAC,IAAa;IACjC,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAClB,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACxB,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE,CAAC;QAC/B,OAAO,YAAY,CAAC;IACtB,CAAC;IACD,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO,mCAAmC,CAAC;IAC7C,CAAC;IACD,OAAO,GAAG,OAAO,IAAI,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC;AAC/D,CAAC;AAgBD,SAAS,SAAS,CAChB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AC1F,MAAM,UAAU,GAAG;QACjB,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5C,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU;KAC1B,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;IACjD,MAAM,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,QAAQ,KAAK,WAAW,CAAC,CAAC;IACnF,OAAO;QACL,QAAQ,EAAE,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,QAAQ,KAAK,UAAU,CAAC;QACzE,UAAU,EAAE,SAAS,KAAK,SAAS;QACnC,YAAY,EAAE,SAAS,EAAE,YAAY;KACtC,CAAC;AACJ,CAAC"}
|
package/dist/descriptors.d.ts
CHANGED
|
@@ -52,6 +52,10 @@ export interface IInputSpec {
|
|
|
52
52
|
readonly transient: boolean;
|
|
53
53
|
/** Accept `--no-<name>` to set a flag to `false`. */
|
|
54
54
|
readonly negatable: boolean;
|
|
55
|
+
/** Created by `ta.rest()`: take every token after the command token as a value, without parsing it. */
|
|
56
|
+
readonly rest: boolean;
|
|
57
|
+
/** Text used as the value when the option is given without one, or `null` if it needs one. */
|
|
58
|
+
readonly preset: string | null;
|
|
55
59
|
}
|
|
56
60
|
export type IPresence = 'optional' | 'required' | 'defaulted';
|
|
57
61
|
/**
|
|
@@ -129,6 +133,12 @@ export declare class ValueArg<TValue, TPresent extends boolean = false> extends
|
|
|
129
133
|
* Only one argument can accept positional values in each active command scope.
|
|
130
134
|
*/
|
|
131
135
|
positional(): ValueArg<TValue, TPresent>;
|
|
136
|
+
/**
|
|
137
|
+
* Let the option be given without a value, such as `--color` instead of `--color always`.
|
|
138
|
+
* Then it gets `text`, which goes through the converter like a typed value.
|
|
139
|
+
* A value right after the option is still taken, unless it starts with a dash or is a command name.
|
|
140
|
+
*/
|
|
141
|
+
preset(text: string): ValueArg<TValue, TPresent>;
|
|
132
142
|
/**
|
|
133
143
|
* Accept multiple values and return an array of converted values.
|
|
134
144
|
* Call this before `required()` or `default()`.
|
|
@@ -300,6 +310,16 @@ export interface IBuilder {
|
|
|
300
310
|
* Use `ta.flag(...).default(false)` to get `false` when the flag is omitted.
|
|
301
311
|
*/
|
|
302
312
|
flag(names: IOptionNames, description: string): FlagArg;
|
|
313
|
+
/**
|
|
314
|
+
* Define a list that takes everything after the command name as it is, such as
|
|
315
|
+
* `ssh -p 2222 host` for a command that wraps another program. What looks like this
|
|
316
|
+
* program's options goes into the list too, so common options have to come before the
|
|
317
|
+
* command. `-h` or `--help` right after the command still shows its help.
|
|
318
|
+
*
|
|
319
|
+
* Place it in a command that has no options of its own. The option name is never typed,
|
|
320
|
+
* but it names the list in help, errors and remembered values.
|
|
321
|
+
*/
|
|
322
|
+
rest(names: IOptionNames, description: string): ListArg<string>;
|
|
303
323
|
/**
|
|
304
324
|
* Define a command with no arguments of its own.
|
|
305
325
|
*/
|
package/dist/descriptors.js
CHANGED
|
@@ -111,6 +111,17 @@ class ValueArg extends Arg {
|
|
|
111
111
|
positional() {
|
|
112
112
|
return new ValueArg(withInput(this, { positional: true }));
|
|
113
113
|
}
|
|
114
|
+
/**
|
|
115
|
+
* Let the option be given without a value, such as `--color` instead of `--color always`.
|
|
116
|
+
* Then it gets `text`, which goes through the converter like a typed value.
|
|
117
|
+
* A value right after the option is still taken, unless it starts with a dash or is a command name.
|
|
118
|
+
*/
|
|
119
|
+
preset(text) {
|
|
120
|
+
if (typeof text !== 'string') {
|
|
121
|
+
throw new errors_1.DefinitionError(`preset of ${inputDisplayName(stateOf(this).input)} must be a string, like a typed value`);
|
|
122
|
+
}
|
|
123
|
+
return new ValueArg(withInput(this, { preset: text }));
|
|
124
|
+
}
|
|
114
125
|
/**
|
|
115
126
|
* Accept multiple values and return an array of converted values.
|
|
116
127
|
* Call this before `required()` or `default()`.
|
|
@@ -120,6 +131,9 @@ class ValueArg extends Arg {
|
|
|
120
131
|
if (state.presence !== 'optional') {
|
|
121
132
|
throw new errors_1.DefinitionError(`multiple() on ${inputDisplayName(state.input)} must be called before required() or default()`);
|
|
122
133
|
}
|
|
134
|
+
if (state.input.preset !== null) {
|
|
135
|
+
throw new errors_1.DefinitionError(`${inputDisplayName(state.input)} has a preset, so it can't take multiple values`);
|
|
136
|
+
}
|
|
123
137
|
if (typeof options !== 'object' || options === null) {
|
|
124
138
|
throw new errors_1.DefinitionError(`multiple() options must be given as an object`);
|
|
125
139
|
}
|
|
@@ -315,6 +329,8 @@ function createInput(kind, names, description, convert, valueType) {
|
|
|
315
329
|
sensitive: false,
|
|
316
330
|
transient: false,
|
|
317
331
|
negatable: false,
|
|
332
|
+
rest: false,
|
|
333
|
+
preset: null,
|
|
318
334
|
};
|
|
319
335
|
assertDescription(description, inputDisplayName(input));
|
|
320
336
|
return Object.freeze({ ...input, description });
|
|
@@ -353,6 +369,14 @@ function flag(names, description) {
|
|
|
353
369
|
defaultValue: undefined,
|
|
354
370
|
});
|
|
355
371
|
}
|
|
372
|
+
function rest(names, description) {
|
|
373
|
+
const input = createInput('value', names, description, convertString, 'string');
|
|
374
|
+
return new ListArg({
|
|
375
|
+
input: Object.freeze({ ...input, multiple: true, positional: true, rest: true }),
|
|
376
|
+
presence: 'optional',
|
|
377
|
+
defaultValue: undefined,
|
|
378
|
+
});
|
|
379
|
+
}
|
|
356
380
|
function command(token, description, shape = {}) {
|
|
357
381
|
if (typeof token !== 'string' || !/^[^\s=-][^\s=]*$/.test(token)) {
|
|
358
382
|
throw new errors_1.DefinitionError(`invalid command name "${String(token)}". Command names can't be empty, start with a dash, or contain spaces`);
|
|
@@ -379,6 +403,6 @@ function meta() {
|
|
|
379
403
|
}
|
|
380
404
|
/** Create the builder passed to the definition callback. */
|
|
381
405
|
function createBuilder() {
|
|
382
|
-
return Object.freeze({ arg, flag, command, meta });
|
|
406
|
+
return Object.freeze({ arg, flag, rest, command, meta });
|
|
383
407
|
}
|
|
384
408
|
//# sourceMappingURL=descriptors.js.map
|
package/dist/descriptors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"descriptors.js","sourceRoot":"","sources":["../src/descriptors.ts"],"names":[],"mappings":";;;AAsGA,kCAEC;AAED,0CAEC;AAGD,4CAMC;AAGD,wCAEC;AAwQD,wBAEC;AAgND,sCAOC;AAyKD,sCAEC;AAtwBD,qCAA2C;AAC3C,mCAAmD;AA8FnD,MAAM,UAAU,GAAG,IAAI,OAAO,EAAqB,CAAC;AACpD,MAAM,cAAc,GAAG,IAAI,OAAO,EAAyB,CAAC;AAE5D;;;GAGG;AACH,SAAgB,WAAW,CAAC,KAAc;IACxC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACzF,CAAC;AAED,SAAgB,eAAe,CAAC,KAAc;IAC5C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC7F,CAAC;AAED,qFAAqF;AACrF,SAAgB,gBAAgB,CAAC,KAAiB;IAChD,MAAM,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC;IAC/B,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,OAAO,KAAK,QAAQ,EAAE,CAAC;IACzB,CAAC;IACD,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;AACtC,CAAC;AAED,0EAA0E;AAC1E,SAAgB,cAAc,CAAC,KAAiB;IAC9C,OAAO,CAAC,GAAG,KAAK,CAAC,O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CAAC,oBAAoB,KAAK,8BAA8B,CAAC,CAAC;IACrF,CAAC;IAED,OAAO,IAAI,OAAO,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;AACzD,CAAC;AAED,SAAS,IAAI;IACX,OAAO,IAAI,IAAI,EAAE,CAAC;AACpB,CAAC;AAED,4DAA4D;AAC5D,SAAgB,aAAa;IAC3B,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;AAC3D,CAAC"}
|
package/dist/display.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { ICompiledCommand, ICompiledSchema } from './compile';
|
|
|
2
2
|
import { IInputSpec } from './descriptors';
|
|
3
3
|
import { IUsageIssue } from './errors';
|
|
4
4
|
import { IAppInfo } from './options';
|
|
5
|
+
import { IBlockGroup, ICustomization, IRowContent } from './sections';
|
|
5
6
|
import { IStyleSpecPainter } from './styling';
|
|
6
7
|
import { ITextTools } from './tools';
|
|
7
8
|
/** Program metadata, schema, styling, and text tools used to render help. */
|
|
@@ -14,6 +15,7 @@ export interface IDisplayContext {
|
|
|
14
15
|
readonly text: ITextTools;
|
|
15
16
|
/** Available width in terminal columns. */
|
|
16
17
|
readonly width: number;
|
|
18
|
+
readonly customization?: ICustomization | undefined;
|
|
17
19
|
}
|
|
18
20
|
/** Fallback help width when terminal dimensions are unavailable. */
|
|
19
21
|
export declare const FALLBACK_WIDTH = 80;
|
|
@@ -23,6 +25,22 @@ export declare const BANNER_LOGO_GAP = 3;
|
|
|
23
25
|
export declare function inputValueLabel(input: IInputSpec): string;
|
|
24
26
|
/** Format a default value for help. Returns `null` if it has no supported text representation. */
|
|
25
27
|
export declare function formatDefault(value: unknown): string | null;
|
|
28
|
+
/** One piece of a laid out line of section content. */
|
|
29
|
+
export interface IContentPart {
|
|
30
|
+
readonly x: number;
|
|
31
|
+
readonly text: string;
|
|
32
|
+
readonly style: 'section_title' | 'text' | 'raw' | 'row_name' | 'row_description';
|
|
33
|
+
/** Row the part comes from, or `null` for titles and text. */
|
|
34
|
+
readonly row: IRowContent | null;
|
|
35
|
+
}
|
|
36
|
+
export type IContentLine = readonly IContentPart[];
|
|
37
|
+
/**
|
|
38
|
+
* Arrange a title, text, or rows in lines that fit `width`.
|
|
39
|
+
* Titles start at the left edge, everything else at `indent`. Banners are left to the caller.
|
|
40
|
+
*/
|
|
41
|
+
export declare function layoutGroup(group: Exclude<IBlockGroup, {
|
|
42
|
+
kind: 'banner';
|
|
43
|
+
}>, text: ITextTools, width: number, indent: number): IContentLine[];
|
|
26
44
|
export interface IBannerPart {
|
|
27
45
|
readonly x: number;
|
|
28
46
|
readonly text: string;
|
|
@@ -30,14 +48,17 @@ export interface IBannerPart {
|
|
|
30
48
|
}
|
|
31
49
|
export interface IBannerLayout {
|
|
32
50
|
readonly rows: readonly (readonly IBannerPart[])[];
|
|
33
|
-
readonly logo: 'beside' | 'above' | 'none';
|
|
51
|
+
readonly logo: 'beside' | 'above' | 'below' | 'none';
|
|
34
52
|
readonly textWidth: number;
|
|
35
53
|
}
|
|
36
54
|
/** Arrange the banner shared by help and interactive mode, before applying terminal styles. */
|
|
37
55
|
export declare function layoutBanner(appInfo: IAppInfo, text: ITextTools, width: number): IBannerLayout;
|
|
38
|
-
/**
|
|
56
|
+
/**
|
|
57
|
+
* Banner width that fits the text without needless wrapping, with the logo right after it,
|
|
58
|
+
* or as wide as the logo above or below it.
|
|
59
|
+
*/
|
|
39
60
|
export declare function preferredBannerWidth(appInfo: IAppInfo, text: ITextTools): number;
|
|
40
|
-
/** Help banner with title, description, version, and an optional logo
|
|
61
|
+
/** Help banner with title, description, version, and an optional logo. */
|
|
41
62
|
export declare function renderBanner(context: IDisplayContext): string[];
|
|
42
63
|
/** Render help for the program when `command` is `null`, or for the selected command otherwise. */
|
|
43
64
|
export declare function renderHelp(context: IDisplayContext, command: ICompiledCommand | null): string;
|