@@ -11,29 +11,30 @@ name: cli
1111help : Sample application that requires environment variables
1212version : 0.1.0
1313
14- # These two variable options add usage text to the help message in the
15- # generated script.
16- # In addition, the value of the variable `ENVIRONMENT` will be set to
17- # `development` if it is not already set by the user.
14+ # This option adds usage text to the help message in the generated script.
1815environment_variables :
1916- name : api_key
2017 help : Set your API key
21- - name : environment
22- help : One of development, production or test
23- default : development
2418
2519commands :
2620- name : verify
2721 short : v
2822 help : Verify your user
2923
3024 # This option belongs to the `verify` command and will appear in its help
31- # message. In addition, setting `required: true` will halt the script's
32- # execution with a friendly error message, unless the variable is set.
25+ # message.
3326 environment_variables :
27+ # Setting `required: true` will halt the script's execution with a
28+ # friendly error message, unless the variable is set.
3429 - name : my_secret
3530 help : Your secret
3631 required : true
32+
33+ # Using the `default: value` option will cause the value to variable to be
34+ # set if it is not provided by the user.
35+ - name : environment
36+ help : One of development, production or test
37+ default : development
3738` ` `
3839
3940## Generated script output
@@ -79,10 +80,6 @@ Environment Variables:
7980 API_KEY
8081 Set your API key
8182
82- ENVIRONMENT
83- One of development, production or test
84- Default: development
85-
8683
8784
8885` ` `
@@ -106,6 +103,10 @@ Environment Variables:
106103 MY_SECRET (required)
107104 Your secret
108105
106+ ENVIRONMENT
107+ One of development, production or test
108+ Default: development
109+
109110
110111
111112` ` `
@@ -133,10 +134,17 @@ environment:
133134
134135` ` `
135136
136- # ## `$ ENVIRONMENT=production ./cli verify`
137+ # ## `$ ENVIRONMENT=production MY_SECRET=safe-with-me ./cli verify`
137138
138139` ` ` shell
139- missing required environment variable: MY_SECRET
140+ # this file is located in 'src/verify_command.sh'
141+ # code for 'cli verify' goes here
142+ # you can edit it freely and regenerate (it will not be overwritten)
143+ args: none
144+ environment:
145+ - API_KEY=
146+ - ENVIRONMENT=production
147+ - MY_SECRET=safe-with-me
140148
141149
142150` ` `
0 commit comments