@kearisp/cli
Advanced tools
Comparing version 2.0.6-dev.3 to 2.0.6-dev.4
@@ -97,3 +97,3 @@ "use strict"; | ||
this.name = Path.basename(scriptPath); | ||
this.command(`complete [index] [prev] [command]`) | ||
this.command("complete [index] [command]") | ||
.help({ | ||
@@ -100,0 +100,0 @@ description: "Generate completion script", |
@@ -28,2 +28,3 @@ import { Option } from "../types"; | ||
protected getOptionSettings(name?: string, alias?: string): Option; | ||
setDescription(description: string): this; | ||
help(params: HelpParams): this; | ||
@@ -30,0 +31,0 @@ completion(name: Completion["name"], handle: Completion["action"]): this; |
@@ -53,2 +53,6 @@ "use strict"; | ||
} | ||
setDescription(description) { | ||
this._description = description; | ||
return this; | ||
} | ||
help(params) { | ||
@@ -55,0 +59,0 @@ const { disabled = false, description = "" } = typeof params === "boolean" ? { |
@@ -9,3 +9,3 @@ "use strict"; | ||
_${name}_completion() { | ||
compadd -- \`${name} complete --compzsh --compgen "\${CURRENT}" "\${words[CURRENT - 1]}" \${BUFFER}\` | ||
compadd -- \`${name} complete --compzsh --compgen "\${CURRENT}" \${BUFFER}\` | ||
} | ||
@@ -20,3 +20,3 @@ | ||
local OPTIONS=$(${name} complete --compbash --compgen "$((COMP_CWORD - (nb_colon * 2)))" "$prev" "\${COMP_LINE}") | ||
local OPTIONS=$(${name} complete --compbash --compgen "$((COMP_CWORD - (nb_colon * 2)))" "\${COMP_LINE}") | ||
@@ -62,3 +62,3 @@ COMPREPLY=() | ||
si="$IFS" | ||
if ! IFS=$'\n' reply=($(${name} complete --compzsh --compgen "\${cword}" "\${words[cword - 1]}" \${line})); then | ||
if ! IFS=$'\n' reply=($(${name} complete --compzsh --compgen "\${cword}" \${line})); then | ||
local ret=$? | ||
@@ -65,0 +65,0 @@ IFS="$si" |
{ | ||
"name": "@kearisp/cli", | ||
"version": "2.0.6-dev.3", | ||
"version": "2.0.6-dev.4", | ||
"license": "MIT", | ||
@@ -25,7 +25,7 @@ "author": "Kris Papercut <krispcut@gmail.com>", | ||
"watch": "tsc --watch", | ||
"test": "KP_LOG=disable jest --colors", | ||
"test-watch": "KP_LOG=log jest --colors --watchAll", | ||
"test-watch:cli": "KP_LOG=log jest --colors --watchAll --runTestsByPath ./src/makes/Cli.spec.ts", | ||
"test-watch:command": "KP_LOG=log jest --colors --watchAll --runTestsByPath ./src/makes/Command.spec.ts", | ||
"test-watch:parser": "KP_LOG=log jest --colors --watchAll --runTestsByPath ./src/makes/Parser.spec.ts" | ||
"test": "KP_LOG=disable jest --colors --no-coverage", | ||
"test-watch": "jest --colors --watchAll", | ||
"test-watch:cli": "jest --colors --watchAll --runTestsByPath ./src/makes/Cli.spec.ts", | ||
"test-watch:command": "jest --colors --watchAll --runTestsByPath ./src/makes/Command.spec.ts", | ||
"test-watch:parser": "jest --colors --watchAll --runTestsByPath ./src/makes/Parser.spec.ts" | ||
}, | ||
@@ -32,0 +32,0 @@ "dependencies": { |
46253
1150