1 |
## our_shell: ysh
|
2 |
## oils_failures_allowed: 1
|
3 |
|
4 |
|
5 |
|
6 |
source $LIB_YSH/args.ysh
|
7 |
|
8 |
parser (&spec) {
|
9 |
# TODO: implement description, prog and help message
|
10 |
description '''
|
11 |
Reference Implementation
|
12 |
'''
|
13 |
prog "program-name"
|
14 |
|
15 |
arg -v --verbose (Bool, help = "Verbose")
|
16 |
arg src
|
17 |
arg dst
|
18 |
}
|
19 |
var argv = ['-h', 'src', 'dst']
|
20 |
|
21 |
# Help
|
22 |
var args = parseArgs(spec, argv)
|
23 |
|
24 |
## STDOUT:
|
25 |
usage: program-name [-h] [-v] src dst
|
26 |
|
27 |
Reference Implementation
|
28 |
|
29 |
positional arguments:
|
30 |
src
|
31 |
dst
|
32 |
|
33 |
options:
|
34 |
-h, --help show this help message and exit
|
35 |
-v, --verbose Verbose
|
36 |
## END
|
37 |
|