Skip to content

Commit 849aeb8

Browse files
committed
update settings with enable_* tweaks
1 parent 04163a1 commit 849aeb8

File tree

1 file changed

+89
-19
lines changed

1 file changed

+89
-19
lines changed

src/usage/settings.md

Lines changed: 89 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -162,25 +162,6 @@ or `-f=value`
162162
- `conjoined_flag_args: true` - Expand `--flag=value` to `--flag value` and `-f=value` to `-f value`.
163163
- `conjoined_flag_args: false` - Do not expand `--flag=value` or `-f=value` (consider this an invalid input).
164164

165-
### `env`
166-
167-
```yaml
168-
# default
169-
env: development
170-
```
171-
172-
Specify if the generated script should include development related comments and
173-
functions or not.
174-
175-
- `env: development` - Generate with file markers and development functions, such as `inspect_args()`.
176-
- `env: production` - Generate a smaller script, without file markers and development functions.
177-
178-
!!!success File Markers
179-
File markers are special comments that are injected to the final script and
180-
specify the name of the internal bashly template (view) or the path to the
181-
user's partial code files.
182-
!!!
183-
184165
### `partials_extension`
185166

186167
```yaml
@@ -224,6 +205,95 @@ all the private elements in the usage texts, as if they were public.
224205

225206
[!button variant="primary" icon="code-review" text="Private Reveal Example"](https://github.com/DannyBen/bashly/tree/master/examples/private-reveal#readme)
226207

208+
### `env`
209+
210+
```yaml
211+
# default
212+
env: development
213+
```
214+
215+
Specify one of two script rendering environments:
216+
217+
- `env: development` - Generate a script suitable for development, which is usually slightly larger
218+
and contains additional development-specific features.
219+
- `env: production` - Generate a script suitable for distribution, which is usually smaller.
220+
221+
Use the `enable_*` options below to adjust settings for each environment.
222+
223+
!!! Note
224+
It is recommended to leave this set to `development` in the settings file, and
225+
use either the `BASHLY_ENV` environment variable or the
226+
`bashly generate --production` command when the slimmer production script is needed.
227+
!!!
228+
229+
230+
### `enable_header_comment`
231+
232+
```yaml
233+
# default (allowed: always, never, development, production)
234+
enable_header_comment: always
235+
```
236+
237+
Specify if you wish to render the "do not modify" comment at the beginning of
238+
the script.
239+
240+
### `enable_bash3_bouncer`
241+
242+
```yaml
243+
# default (allowed: always, never, development, production)
244+
enable_bash3_bouncer: always
245+
```
246+
247+
Specify if you wish to render the piece of code that aborts the script execution
248+
when bash version is < 4.
249+
250+
### `enable_view_markers`
251+
252+
```yaml
253+
# default (allowed: always, never, development, production)
254+
enable_view_markers: development
255+
```
256+
257+
Specify if you want the rendered script to include view marker comments.
258+
259+
View markers provide the name of the internal bashly template (view) or the
260+
path to the user's partial code files in the final script, to help locate
261+
the source file for each piece of code.
262+
263+
### `enable_inspect_args`
264+
265+
```yaml
266+
# default (allowed: always, never, development, production)
267+
enable_inspect_args: development
268+
```
269+
270+
Specify if you want the rendered script to include the `inspect_args()` function.
271+
272+
The `inspect_args()` function can help in reviewing the input for each command.
273+
274+
### `enable_deps_array`
275+
276+
```yaml
277+
# default (allowed: always, never, development, production)
278+
enable_deps_array: always
279+
```
280+
281+
Specify if you want to populate the `$deps` bash array.
282+
283+
This is applicable only if your script uses the
284+
[Dependency](/configuration/dependency) configuration option.
285+
286+
### `enable_env_var_names_array`
287+
288+
```yaml
289+
# default (allowed: always, never, development, production)
290+
enable_env_var_names_array: always
291+
```
292+
293+
Specify if you want to populate the `$env_var_names` bash array.
294+
295+
This is applicable only if your script uses the
296+
[Environment Variable](/configuration/environment-variable) configuration option.
227297

228298
### `usage_colors`
229299

0 commit comments

Comments
 (0)