@@ -119,6 +119,15 @@ See the [examples](examples) folder for more examples.
119119Configuration Reference
120120--------------------------------------------------
121121
122+ The ` bashly.yml ` configuration file consists of these types:
123+
124+ - [ Command] ( #command-options ) - defines the root command as well as any
125+ subcommand.
126+ - [ Argument] ( #argument-options ) - defines positional arguments.
127+ - [ Flag] ( #flag-options ) - defines option flags.
128+ - [ Environment Variables] ( #environment-variables-options ) - defines
129+ environment variables required (or desired) by your script.
130+
122131### Command options
123132
124133Unless otherwise specified, these definitiona can be used for both the root
@@ -149,11 +158,9 @@ examples:
149158- myscript download
150159- myscript download --force
151160
152- # Specify an array of environment variables needed by your script
153- # This is used purely for displaying in the help text (when using --help)
154- # The help for each variable can have multiple lines.
155- environment_variable :
156- VARIABLE_NAME : Variable help text
161+ # Specify an array of environment variables needed by your script.
162+ environment_variables :
163+ - ... see below ...
157164
158165# Specify the array of subcommands to generate.
159166# Each subcommand will have its own args and flags.
@@ -164,12 +171,12 @@ commands:
164171# Specify the array of positional arguments this script needs.
165172# If this is provided, then you cannot specify commands.
166173args :
167- - ...
174+ - ... see below ...
168175
169176# Specify the array of option flags this script needs.
170177# If this is provided, then you cannot specify commands.
171178flags :
172- - ...
179+ - ... see below ...
173180` ` `
174181
175182
@@ -234,6 +241,33 @@ arg: directory
234241required: true
235242` ` `
236243
244+ # ## Environment Variable options
245+
246+ The below configuration generates this environment variable usage text :
247+
248+ ` ` `
249+ Environment Variables:
250+ SECRET_KEY (required)
251+ Your API secret key
252+ ` ` `
253+
254+ If an environment variable is defined as required (false by default), the
255+ execution of the script will be halted with a friendly error if it is not
256+ set.
257+
258+ ` ` ` yaml
259+ # The name of the variable (it will be automatically capitalized).
260+ name: secret_key
261+
262+ # The message to display when using --help.
263+ # This can have multiple lines.
264+ help: Your API secret key
265+
266+ # Specify if this variable is required.
267+ required: true
268+ ` ` `
269+
270+
237271
238272Real World Examples
239273--------------------------------------------------
0 commit comments