cli-kiss 0.2.7 → 0.2.9
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 +8 -3
- package/dist/index.d.ts +200 -190
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/docs/.vitepress/config.mts +1 -1
- package/docs/.vitepress/theme/Layout.vue +16 -0
- package/docs/.vitepress/theme/index.ts +5 -1
- package/docs/.vitepress/theme/style.css +5 -1
- package/docs/guide/01_getting_started.md +2 -2
- package/docs/guide/02_commands.md +3 -3
- package/docs/guide/03_options.md +11 -11
- package/docs/guide/04_positionals.md +9 -9
- package/docs/guide/05_input_types.md +17 -16
- package/docs/guide/06_run_as_cli.md +1 -1
- package/docs/index.md +2 -2
- package/docs/public/favicon.ico +0 -0
- package/docs/public/logo.png +0 -0
- package/package.json +1 -1
- package/src/index.ts +1 -1
- package/src/lib/Command.ts +51 -40
- package/src/lib/Operation.ts +41 -25
- package/src/lib/Option.ts +198 -127
- package/src/lib/Positional.ts +51 -25
- package/src/lib/Reader.ts +188 -226
- package/src/lib/Run.ts +20 -9
- package/src/lib/Suggest.ts +78 -0
- package/src/lib/Type.ts +178 -154
- package/src/lib/Typo.ts +58 -55
- package/src/lib/Usage.ts +12 -12
- package/tests/unit.Reader.commons.ts +86 -123
- package/tests/unit.Reader.parsings.ts +14 -26
- package/tests/unit.Reader.shortBig.ts +75 -101
- package/tests/unit.command.aliases.ts +88 -0
- package/tests/unit.command.execute.ts +6 -6
- package/tests/unit.command.usage.ts +19 -13
- package/tests/unit.fuzzed.alternatives.ts +35 -26
- package/tests/unit.runner.colors.ts +8 -33
- package/tests/unit.runner.cycle.ts +141 -156
- package/tests/unit.runner.errors.ts +25 -22
- package/docs/public/hero.png +0 -0
- package/src/lib/Similarity.ts +0 -41
- package/tests/unit.Reader.aliases.ts +0 -62
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
optionFlag,
|
|
26
26
|
positionalRequired,
|
|
27
27
|
runAndExit,
|
|
28
|
-
|
|
28
|
+
typeString,
|
|
29
29
|
} from "cli-kiss";
|
|
30
30
|
|
|
31
31
|
const greet = command(
|
|
@@ -35,7 +35,12 @@ const greet = command(
|
|
|
35
35
|
options: {
|
|
36
36
|
loud: optionFlag({ long: "loud", description: "Print in uppercase" }),
|
|
37
37
|
},
|
|
38
|
-
positionals: [
|
|
38
|
+
positionals: [
|
|
39
|
+
positionalRequired({
|
|
40
|
+
type: typeString("name"),
|
|
41
|
+
description: "The name of the person to greet",
|
|
42
|
+
}),
|
|
43
|
+
],
|
|
39
44
|
},
|
|
40
45
|
async (_ctx, { options: { loud }, positionals: [name] }) => {
|
|
41
46
|
const text = `Hello, ${name}!`;
|
|
@@ -59,7 +64,7 @@ Usage: greet <name>
|
|
|
59
64
|
Greet someone
|
|
60
65
|
|
|
61
66
|
Positionals:
|
|
62
|
-
<name>
|
|
67
|
+
<name> The name of the person to greet
|
|
63
68
|
|
|
64
69
|
Options:
|
|
65
70
|
--loud[=no] Print in uppercase
|