@@ -39,22 +39,46 @@ flags:
3939 short : -l
4040 arg : path
4141 help : Path to log file
42+
43+ # Arguments in argfile also work for repeatable flags
44+ - long : --header
45+ short : -H
46+ arg : value
47+ repeatable : true
48+ help : Add an HTTP header
4249` ` ` `
4350
4451# # `.download`
4552
4653` ` ` ` bash
54+ # Boolean flags in the argfile are loaded as defaults
4755--force
56+
57+ # Flag values must appear on the same line
4858--log "some path with spaces.log"
4959
50- ````
60+ # Arguments in argfile also work for repeatable flags
61+ --header "x-from-file : 1"
5162
52- Only flag lines are loaded from the argfile. Each flag value must appear on the
53- same line as the flag. Non-flag lines are ignored.
63+ # Unknown flags in the argfile are ignored
64+ --no-such-flag
65+
66+ # Non-flag lines in the argfile are ignored
67+ this line is ignored
68+
69+ ````
5470
5571
5672## Output
5773
74+ ### ` $ ./download --version `
75+
76+ ```` shell
77+ 0.1.0
78+
79+
80+ ````
81+
5882### ` $ ./download somesource `
5983
6084```` shell
@@ -64,24 +88,30 @@ same line as the flag. Non-flag lines are ignored.
6488# Feel free to edit this file; your changes will persist when regenerating.
6589args:
6690- ${args[--force]} = 1
91+ - ${args[--header]} = x-from-file:\ 1
6792- ${args[--log]} = some path with spaces.log
6893- ${args[source]} = somesource
6994
7095
7196````
7297
73- ### ` $ ./download --help `
98+ ### ` $ ./download somesource --log cli.log `
7499
75100```` shell
76- download - Sample application with autoloaded arguments
101+ # This file is located at 'src/root_command.sh'.
102+ # It contains the implementation for the 'download' command.
103+ # The code you write here will be wrapped by a function named 'root_command()'.
104+ # Feel free to edit this file; your changes will persist when regenerating.
105+ args:
106+ - ${args[--force]} = 1
107+ - ${args[--header]} = x-from-file:\ 1
108+ - ${args[--log]} = cli.log
109+ - ${args[source]} = somesource
110+
77111
78- Usage:
79- download SOURCE [OPTIONS]
80- download --help | -h
81- download --version | -v
82112````
83113
84- ### ` $ ./download somesource --log cli.log `
114+ ### ` $ ./download somesource --header "x-from- cli: 2" `
85115
86116```` shell
87117# This file is located at 'src/root_command.sh'.
@@ -90,10 +120,12 @@ Usage:
90120# Feel free to edit this file; your changes will persist when regenerating.
91121args:
92122- ${args[--force]} = 1
93- - ${args[--log]} = cli.log
123+ - ${args[--header]} = x-from-file:\ 1 x-from-cli:\ 2
124+ - ${args[--log]} = some path with spaces.log
94125- ${args[source]} = somesource
95126
96127
97128````
98129
99130
131+
0 commit comments