1.1.1 • Published 10 months ago
@0x-jerry/silver v1.1.1
Silver
Let writing CLI like writing a document.
Install
pnpm i @0x-jerry/silver
Usage
Example:
import { silver } from '@0x-jerry/silver'
// @autocompletion will enable `completion` subcommand to generate autocomplete script
// Autocompletion only support zsh for now, and need to install manually
// Manual install: you need to append `source <(silver completion)` to `.zshrc`
const ins = sliver`
v1.0.0 @autocompletion
Silver, let you writing CLI like writing document. ${defaultAction}
-t --test @test:defaultValue, Test autocompletion.
up/upgrade <@test:dir> [...other] #stopEarly, an sub command. ${upgradeAction}
-s --string @string:default, sub command option.
--small @bool, other option.
`
// register autocomplete
ins.type('type', () => ['t1', 't2', 't3'])
function defaultAction([type], options) {
console.log(type, options)
}
function upgradeAction([dir], options) {
console.log(dir, options)
}
Syntax Detail
Please see syntax.ohm.
Thanks
1.1.1
10 months ago
1.1.0
10 months ago
1.0.2
12 months ago
1.0.1
12 months ago
1.0.0
12 months ago
1.0.3
12 months ago
0.1.9
12 months ago
0.1.8
1 year ago
0.1.7
1 year ago
0.1.6
1 year ago
0.1.5
2 years ago
0.1.0
2 years ago
0.1.2
2 years ago
0.1.1
2 years ago
0.1.4
2 years ago
0.1.3
2 years ago
0.1.0-3
2 years ago
0.1.0-2
2 years ago
0.1.0-1
2 years ago