bashly 1.2.8 → 1.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8e0ea93f1ae2d4de7347c78c66eded0c3af9a815e444efbe6450292d5808e1cd
4
- data.tar.gz: f301168efb623543d51e26e433ac0935e874e1d70b5b59e9c0300e451e3e4fdd
3
+ metadata.gz: 69bab1b1c954940d944ed30bbf0b30627cf02cb793bed1220006d0e232e69871
4
+ data.tar.gz: d2219c883f7f12ca243f5cd60aac8feeb1eb7659811ee3f3ae6a48ec0fd33e1d
5
5
  SHA512:
6
- metadata.gz: 9ebcf92ca566a54989af2fdf2f2ba6e59d87972fc3e958cfd280205b831a77fc27fd9c2a18c2f5b3f89d7e36754a0981b84c400214f8653bfc9dd79d099e8fe7
7
- data.tar.gz: 82a22bd78ed9e19d3efc2d519da526943ec38a4c4cd0456779d2bde1fc452f007fe9363a1e9fc44753d6724df0a0a1ddd615fbeebc00504846cbe6171e8934d8
6
+ metadata.gz: '096d99390ec2f1e00501f86e062d22d3a4ea85b545e504afd631615bea0e09e6c802d4e40a9fb29ada02f5ec2353ce2c6d0a936259b496c02563fc78a85857f5'
7
+ data.tar.gz: f258e0a87ccf7ab2a4972bc6f784e909a9b6289d5eb00906fd58ebb21972d0e14611599716191dee3115e5c4d544758f4828328020db993105abaadb54097ba9
data/README.md CHANGED
@@ -9,7 +9,7 @@ Create feature-rich bash scripts using simple YAML configuration
9
9
  [![Build Status](https://github.com/DannyBen/bashly/workflows/Test/badge.svg)](https://github.com/DannyBen/bashly/actions?query=workflow%3ATest)
10
10
  [![Maintainability](https://api.codeclimate.com/v1/badges/8cf89047e50ca601e431/maintainability)](https://codeclimate.com/github/DannyBen/bashly/maintainability)
11
11
 
12
- ## [bashly.dannyb.co](https://bashly.dannyb.co)
12
+ ## [bashly.dev](https://bashly.dev)
13
13
 
14
14
  ---
15
15
 
@@ -76,6 +76,6 @@ Visit the *[How to contribute][contributing]* page for more information.
76
76
 
77
77
  [issues]: https://github.com/DannyBen/bashly/issues
78
78
  [discussions]: https://github.com/DannyBen/bashly/discussions
79
- [docs]: https://bashly.dannyb.co/
79
+ [docs]: https://bashly.dev/
80
80
  [examples]: https://github.com/DannyBen/bashly/tree/master/examples#bashly-examples
81
81
  [contributing]: https://github.com/DannyBen/bashly/blob/master/CONTRIBUTING.md#how-to-contribute
data/lib/bashly/cli.rb CHANGED
@@ -7,7 +7,7 @@ module Bashly
7
7
  def self.runner
8
8
  runner = MisterBin::Runner.new version: Bashly::VERSION,
9
9
  header: 'Bashly - Bash CLI Generator',
10
- footer: "Help: m`bashly COMMAND --help`\nDocs: bu`https://bashly.dannyb.co`"
10
+ footer: "Help: m`bashly COMMAND --help`\nDocs: bu`https://bashly.dev`"
11
11
 
12
12
  runner.route 'init', to: Commands::Init
13
13
  runner.route 'preview', to: Commands::Preview
@@ -3,7 +3,7 @@ module Bashly
3
3
  class Add < Base
4
4
  help 'Add extra features and customization to your script'
5
5
 
6
- usage 'bashly add [--source NAME] LIBRARY [ARGS...] [--force]'
6
+ usage 'bashly add [--source NAME] LIBRARY [ARGS...] [--force --quiet]'
7
7
  usage 'bashly add [--source NAME] --list'
8
8
  usage 'bashly add (-h|--help)'
9
9
 
@@ -17,6 +17,7 @@ module Bashly
17
17
  USAGE
18
18
  option '-f --force', 'Overwrite existing files'
19
19
  option '-l --list', 'Show available libraries'
20
+ option '-q --quiet', 'Do not show post-install messages'
20
21
 
21
22
  attr_reader :skip_src_check
22
23
 
@@ -70,7 +71,9 @@ module Bashly
70
71
  end
71
72
 
72
73
  message = library.post_install_message
73
- say "\n#{message}" if message && files_created.positive?
74
+ return if !message || files_created.zero? || args['--quiet']
75
+
76
+ say "\n#{message}"
74
77
  end
75
78
 
76
79
  def safe_write(path, content)
@@ -3,7 +3,7 @@ require 'filewatcher'
3
3
  module Bashly
4
4
  module Commands
5
5
  class Generate < Base
6
- summary "Generate the bash script and required files"
6
+ summary 'Generate the bash script and required files'
7
7
  help "This command is also aliased as 'build'"
8
8
 
9
9
  usage 'bashly generate [options]'
@@ -186,6 +186,7 @@ module Bashly
186
186
 
187
187
  assert_string "#{key}.name", value['name']
188
188
  assert_optional_string "#{key}.help", value['help']
189
+ assert_optional_string "#{key}.help_header_override", value['help_header_override']
189
190
  assert_optional_string "#{key}.footer", value['footer']
190
191
  assert_optional_string "#{key}.group", value['group']
191
192
  assert_optional_string "#{key}.filename", value['filename']
@@ -1,6 +1,6 @@
1
1
  arg:
2
2
  help: Define positional arguments.
3
- url: https://bashly.dannyb.co/configuration/argument/
3
+ url: https://bashly.dev/configuration/argument/
4
4
  example: |-
5
5
  args:
6
6
  - name: user
@@ -16,7 +16,7 @@ arg:
16
16
 
17
17
  arg.allowed:
18
18
  help: Specify a list of allowed values. Can be used in conjunction with `default` and `required`.
19
- url: https://bashly.dannyb.co/configuration/argument/#allowed
19
+ url: https://bashly.dev/configuration/argument/#allowed
20
20
  example: |-
21
21
  args:
22
22
  - name: region
@@ -35,7 +35,7 @@ arg.allowed:
35
35
 
36
36
  arg.default:
37
37
  help: Specify the value to apply when not provided by the user.
38
- url: https://bashly.dannyb.co/configuration/argument/#default
38
+ url: https://bashly.dev/configuration/argument/#default
39
39
  example: |-
40
40
  args:
41
41
  - name: images
@@ -44,7 +44,7 @@ arg.default:
44
44
 
45
45
  arg.help:
46
46
  help: Specify the help message for this argument.
47
- url: https://bashly.dannyb.co/configuration/argument/#help
47
+ url: https://bashly.dev/configuration/argument/#help
48
48
  example: |-
49
49
  args:
50
50
  - name: user
@@ -53,7 +53,7 @@ arg.help:
53
53
 
54
54
  arg.name:
55
55
  help: Specify the lowercase name of the argument.
56
- url: https://bashly.dannyb.co/configuration/argument/#name
56
+ url: https://bashly.dev/configuration/argument/#name
57
57
  example: |-
58
58
  args:
59
59
  - name: user
@@ -67,7 +67,7 @@ arg.repeatable:
67
67
  The argument below will be received as a space-delimited string which needs to be converted to an array with:
68
68
  `eval "data=(${args[file]})"`
69
69
 
70
- url: https://bashly.dannyb.co/configuration/argument/#repeatable
70
+ url: https://bashly.dev/configuration/argument/#repeatable
71
71
  example: |-
72
72
  args:
73
73
  - name: file
@@ -77,7 +77,7 @@ arg.repeatable:
77
77
 
78
78
  arg.required:
79
79
  help: Specify that this argument is required.
80
- url: https://bashly.dannyb.co/configuration/argument/#required
80
+ url: https://bashly.dev/configuration/argument/#required
81
81
  example: |-
82
82
  args:
83
83
  - name: region
@@ -87,7 +87,7 @@ arg.required:
87
87
  arg.validate:
88
88
  help: Apply custom validation functions.
89
89
 
90
- url: https://bashly.dannyb.co/configuration/argument/#validate
90
+ url: https://bashly.dev/configuration/argument/#validate
91
91
  example: |-
92
92
  args:
93
93
  - name: path
@@ -1,6 +1,6 @@
1
1
  command:
2
2
  help: Define the root command, or any sub-command.
3
- url: https://bashly.dannyb.co/configuration/command/
3
+ url: https://bashly.dev/configuration/command/
4
4
  example: |-
5
5
  name: rush
6
6
  help: Personal package manager
@@ -17,7 +17,7 @@ command:
17
17
 
18
18
  command.alias:
19
19
  help: Specify one or more aliases for this sub-command.
20
- url: https://bashly.dannyb.co/configuration/command/#alias
20
+ url: https://bashly.dev/configuration/command/#alias
21
21
  example: |-
22
22
  # Define a single alias
23
23
  command:
@@ -36,7 +36,7 @@ command.alias:
36
36
 
37
37
  command.args:
38
38
  help: Define a list of positional arguments. See `arg` for reference.
39
- url: https://bashly.dannyb.co/configuration/command/#args
39
+ url: https://bashly.dev/configuration/command/#args
40
40
  example: |-
41
41
  args:
42
42
  - name: repo
@@ -45,7 +45,7 @@ command.args:
45
45
 
46
46
  command.catch_all:
47
47
  help: Specify that this command should allow for additional arbitrary arguments or flags.
48
- url: https://bashly.dannyb.co/configuration/command/#catch_all
48
+ url: https://bashly.dev/configuration/command/#catch_all
49
49
  example: |-
50
50
  commands:
51
51
  - name: download
@@ -67,7 +67,7 @@ command.catch_all:
67
67
 
68
68
  command.commands:
69
69
  help: Define a list of sub-commands. See `command` for reference.
70
- url: https://bashly.dannyb.co/configuration/command/#commands
70
+ url: https://bashly.dev/configuration/command/#commands
71
71
  example: |-
72
72
  commands:
73
73
  - name: add
@@ -76,7 +76,7 @@ command.commands:
76
76
 
77
77
  command.completions:
78
78
  help: Specify a list of additional completion suggestions when used in conjunction with `bashly add completions`.
79
- url: https://bashly.dannyb.co/configuration/command/#completions
79
+ url: https://bashly.dev/configuration/command/#completions
80
80
  example: |-
81
81
  commands:
82
82
  - name: view
@@ -88,7 +88,7 @@ command.completions:
88
88
 
89
89
  command.default:
90
90
  help: Specify that this sub-command will be executed implicitly.
91
- url: https://bashly.dannyb.co/configuration/command/#default
91
+ url: https://bashly.dev/configuration/command/#default
92
92
  example: |-
93
93
  # This command will execute when the command line is not
94
94
  # recognized.
@@ -106,7 +106,7 @@ command.default:
106
106
 
107
107
  command.dependencies:
108
108
  help: Specify a list of required external commands that are needed to run this command.
109
- url: https://bashly.dannyb.co/configuration/command/#dependencies
109
+ url: https://bashly.dev/configuration/command/#dependencies
110
110
  example: |-
111
111
  # Array syntax
112
112
  dependencies:
@@ -128,7 +128,7 @@ command.dependencies:
128
128
 
129
129
  command.environment_variables:
130
130
  help: Define a list of environment variables. See `environment_variable` for reference.
131
- url: https://bashly.dannyb.co/configuration/command/#environment_variables
131
+ url: https://bashly.dev/configuration/command/#environment_variables
132
132
  example: |-
133
133
  environment_variables:
134
134
  - name: config_path
@@ -140,7 +140,7 @@ command.environment_variables:
140
140
 
141
141
  command.examples:
142
142
  help: Define one or more example messages.
143
- url: https://bashly.dannyb.co/configuration/command/#examples
143
+ url: https://bashly.dev/configuration/command/#examples
144
144
  example: |-
145
145
  # Use an array of examples for simple one-liners.
146
146
  examples:
@@ -159,7 +159,7 @@ command.examples:
159
159
 
160
160
  command.expose:
161
161
  help: Specify that the sub-commands of this command should be visible when showing the usage of its parent.
162
- url: https://bashly.dannyb.co/configuration/command/#expose
162
+ url: https://bashly.dev/configuration/command/#expose
163
163
  example: |-
164
164
  name: cli
165
165
  commands:
@@ -190,7 +190,7 @@ command.expose:
190
190
 
191
191
  command.extensible:
192
192
  help: Specify that this command can be extended by external means.
193
- url: https://bashly.dannyb.co/configuration/command/#extensible
193
+ url: https://bashly.dev/configuration/command/#extensible
194
194
  example: |-
195
195
  name: mygit
196
196
  help: Wrapper for git
@@ -206,7 +206,7 @@ command.extensible:
206
206
 
207
207
  command.filename:
208
208
  help: Specify the path (relative to src) to the partial source code file.
209
- url: https://bashly.dannyb.co/configuration/command/#filename
209
+ url: https://bashly.dev/configuration/command/#filename
210
210
  example: |-
211
211
  commands:
212
212
  - name: connect
@@ -215,7 +215,7 @@ command.filename:
215
215
 
216
216
  command.filters:
217
217
  help: Specify a list of custom filter functions that will prevent the command from running unless certain conditions are met.
218
- url: https://bashly.dannyb.co/configuration/command/#filters
218
+ url: https://bashly.dev/configuration/command/#filters
219
219
  example: |-
220
220
  commands:
221
221
  - name: container
@@ -235,7 +235,7 @@ command.filters:
235
235
 
236
236
  command.flags:
237
237
  help: Define a list of option flags. See `flag` for reference.
238
- url: https://bashly.dannyb.co/configuration/command/#flags
238
+ url: https://bashly.dev/configuration/command/#flags
239
239
  example: |-
240
240
  flags:
241
241
  - long: --purge
@@ -244,13 +244,13 @@ command.flags:
244
244
 
245
245
  command.footer:
246
246
  help: Specify a message to show at the bottom of the help text.
247
- url: https://bashly.dannyb.co/configuration/command/#footer
247
+ url: https://bashly.dev/configuration/command/#footer
248
248
  example: |-
249
249
  footer: For further help visit https://my.docs-site.com
250
250
 
251
251
  command.function:
252
252
  help: Specify a different base function name for this command.
253
- url: https://bashly.dannyb.co/configuration/command/#function
253
+ url: https://bashly.dev/configuration/command/#function
254
254
  example: |-
255
255
  commands:
256
256
  - name: container-start
@@ -271,7 +271,7 @@ command.function:
271
271
 
272
272
  command.group:
273
273
  help: Specify the group that this command belongs to.
274
- url: https://bashly.dannyb.co/configuration/command/#group
274
+ url: https://bashly.dev/configuration/command/#group
275
275
  example: |-
276
276
  command:
277
277
  name: start
@@ -280,7 +280,7 @@ command.group:
280
280
 
281
281
  command.help:
282
282
  help: Specify the help text to show when displaying usage.
283
- url: https://bashly.dannyb.co/configuration/command/#help
283
+ url: https://bashly.dev/configuration/command/#help
284
284
  example: |-
285
285
  name: docker
286
286
  help: Runtime for containers
@@ -289,9 +289,23 @@ command.help:
289
289
  - name: images
290
290
  help: Manage images
291
291
 
292
+ command.help_header_override:
293
+ help: Provide an alternative bash code (or function call) that will be executed at the beginning of the help message.
294
+
295
+ url: https://bashly.dev/configuration/command/#help_header_override
296
+ example: |-
297
+ name: font-explorer
298
+ help: Font manager utility
299
+
300
+ help_header_override: |
301
+ echo '┏┓ ┏┓ ┓ '
302
+ echo '┣ ┏┓┏┓╋ ┣ ┓┏┏┓┃┏┓┏┓┏┓┏┓'
303
+ echo '┻ ┗┛┛┗┗ ┗┛┛┗┣┛┗┗┛┛ ┗ ┛ '
304
+ echo ' ┛ v1.0'
305
+
292
306
  command.name:
293
307
  help: Specify the name of the command. This option is required.
294
- url: https://bashly.dannyb.co/configuration/command/#name
308
+ url: https://bashly.dev/configuration/command/#name
295
309
  example: |-
296
310
  name: docker
297
311
  help: Runtime for containers
@@ -302,7 +316,7 @@ command.name:
302
316
 
303
317
  command.private:
304
318
  help: Specify that this command should not be displayed in the help text.
305
- url: https://bashly.dannyb.co/configuration/command/#private
319
+ url: https://bashly.dev/configuration/command/#private
306
320
  example: |-
307
321
  commands:
308
322
  - name: completions
@@ -311,7 +325,7 @@ command.private:
311
325
 
312
326
  command.variables:
313
327
  help: Define a list of global bash variables. See `variable` for reference.
314
- url: https://bashly.dannyb.co/configuration/command/#variables
328
+ url: https://bashly.dev/configuration/command/#variables
315
329
  example: |-
316
330
  variables:
317
331
  # Simple value
@@ -332,7 +346,7 @@ command.variables:
332
346
 
333
347
  command.version:
334
348
  help: Specify the version to show when running with `--version`.
335
- url: https://bashly.dannyb.co/configuration/command/#version
349
+ url: https://bashly.dev/configuration/command/#version
336
350
  example: |-
337
351
  name: rush
338
352
  help: Personal package manager
@@ -1,6 +1,6 @@
1
1
  environment_variable:
2
2
  help: Define environment variables that will be in use in your script.
3
- url: https://bashly.dannyb.co/configuration/environment-variable/
3
+ url: https://bashly.dev/configuration/environment-variable/
4
4
  example: |-
5
5
  environment_variables:
6
6
  - name: config_path
@@ -12,7 +12,7 @@ environment_variable:
12
12
 
13
13
  environment_variable.default:
14
14
  help: Specify the value to apply when not provided by the user.
15
- url: https://bashly.dannyb.co/configuration/environment-variable/#default
15
+ url: https://bashly.dev/configuration/environment-variable/#default
16
16
  example: |-
17
17
  environment_variables:
18
18
  - name: config_path
@@ -21,7 +21,7 @@ environment_variable.default:
21
21
 
22
22
  environment_variable.help:
23
23
  help: Specify the help message for this variable.
24
- url: https://bashly.dannyb.co/configuration/environment-variable/#help
24
+ url: https://bashly.dev/configuration/environment-variable/#help
25
25
  example: |-
26
26
  environment_variables:
27
27
  - name: api_key
@@ -29,7 +29,7 @@ environment_variable.help:
29
29
 
30
30
  environment_variable.name:
31
31
  help: Specify the lowercase name of the variable.
32
- url: https://bashly.dannyb.co/configuration/environment-variable/#name
32
+ url: https://bashly.dev/configuration/environment-variable/#name
33
33
  example: |-
34
34
  environment_variables:
35
35
  - name: api_key
@@ -37,7 +37,7 @@ environment_variable.name:
37
37
 
38
38
  environment_variable.private:
39
39
  help: Specify that this environment variable should not be advertised in the usage text.
40
- url: https://bashly.dannyb.co/configuration/environment-variable/#private
40
+ url: https://bashly.dev/configuration/environment-variable/#private
41
41
  example: |-
42
42
  environment_variables:
43
43
  - name: editor
@@ -47,7 +47,7 @@ environment_variable.private:
47
47
 
48
48
  environment_variable.required:
49
49
  help: Specify that this variable is required.
50
- url: https://bashly.dannyb.co/configuration/environment-variable/#required
50
+ url: https://bashly.dev/configuration/environment-variable/#required
51
51
  example: |-
52
52
  environment_variables:
53
53
  - name: api_key
@@ -57,7 +57,7 @@ environment_variable.required:
57
57
  environment_variable.validate:
58
58
  help: Apply custom validation functions.
59
59
 
60
- url: https://bashly.dannyb.co/configuration/environment-variable/#validate
60
+ url: https://bashly.dev/configuration/environment-variable/#validate
61
61
  example: |-
62
62
  environment_variables:
63
63
  - name: build_dir
@@ -1,6 +1,6 @@
1
1
  flag:
2
2
  help: Define option flags.
3
- url: https://bashly.dannyb.co/configuration/flag/
3
+ url: https://bashly.dev/configuration/flag/
4
4
  example: |-
5
5
  flags:
6
6
  - long: --ssh
@@ -15,7 +15,7 @@ flag:
15
15
 
16
16
  flag.allowed:
17
17
  help: Specify a list of allowed values. Can be used in conjunction with `default` and `required`, and must be accompanied by `arg`.
18
- url: https://bashly.dannyb.co/configuration/flag/#allowed
18
+ url: https://bashly.dev/configuration/flag/#allowed
19
19
  example: |-
20
20
  flags:
21
21
  - long: --user
@@ -38,7 +38,7 @@ flag.allowed:
38
38
 
39
39
  flag.arg:
40
40
  help: Specify the name of the argument for this flag, in case it requires any.
41
- url: https://bashly.dannyb.co/configuration/flag/#arg
41
+ url: https://bashly.dev/configuration/flag/#arg
42
42
  example: |-
43
43
  flags:
44
44
  - long: --user
@@ -48,7 +48,7 @@ flag.arg:
48
48
 
49
49
  flag.completions:
50
50
  help: Specify a list of additional completion suggestions when used in conjunction with `bashly add completions`. Must be accompanied by `arg`.
51
- url: https://bashly.dannyb.co/configuration/flag/#completions
51
+ url: https://bashly.dev/configuration/flag/#completions
52
52
  example: |-
53
53
  flags:
54
54
  - long: --user
@@ -65,7 +65,7 @@ flag.completions:
65
65
 
66
66
  flag.conflicts:
67
67
  help: Specify that this flag is mutually exclusive with one or more other flags. Use the long name of these conflicting flags.
68
- url: https://bashly.dannyb.co/configuration/flag/#conflicts
68
+ url: https://bashly.dev/configuration/flag/#conflicts
69
69
  example: |-
70
70
  flags:
71
71
  - long: --cache
@@ -88,7 +88,7 @@ flag.conflicts:
88
88
 
89
89
  flag.default:
90
90
  help: Specify the value to apply when not provided by the user.
91
- url: https://bashly.dannyb.co/configuration/flag/#default
91
+ url: https://bashly.dev/configuration/flag/#default
92
92
  example: |-
93
93
  flags:
94
94
  - long: --environment
@@ -98,7 +98,7 @@ flag.default:
98
98
 
99
99
  flag.help:
100
100
  help: Specify the help message for this flag.
101
- url: https://bashly.dannyb.co/configuration/flag/#help
101
+ url: https://bashly.dev/configuration/flag/#help
102
102
  example: |-
103
103
  flags:
104
104
  - long: --cache
@@ -106,7 +106,7 @@ flag.help:
106
106
 
107
107
  flag.long:
108
108
  help: Specify the long form of the flag, including the -- prefix. Either `long` or `short` is required.
109
- url: https://bashly.dannyb.co/configuration/flag/#long
109
+ url: https://bashly.dev/configuration/flag/#long
110
110
  example: |-
111
111
  flags:
112
112
  - long: --ssh
@@ -115,7 +115,7 @@ flag.long:
115
115
 
116
116
  flag.needs:
117
117
  help: Specify that this flag needs one or more additional flags. Use the long name of these needed flags.
118
- url: https://bashly.dannyb.co/configuration/flag/#needs
118
+ url: https://bashly.dev/configuration/flag/#needs
119
119
  example: |-
120
120
  flags:
121
121
  - long: --add
@@ -138,7 +138,7 @@ flag.needs:
138
138
 
139
139
  flag.private:
140
140
  help: Specify that this flag should not be displayed in the help text.
141
- url: https://bashly.dannyb.co/configuration/flag/#private
141
+ url: https://bashly.dev/configuration/flag/#private
142
142
  example: |-
143
143
  flags:
144
144
  - long: --legacy
@@ -151,7 +151,7 @@ flag.repeatable:
151
151
  Specify that this flag can be provided multiple times. When used on a flag with an argument, it will be received as a space-delimited string, which needs to be converted to an array with:
152
152
  `eval "data=(${args[--data]})"`
153
153
 
154
- url: https://bashly.dannyb.co/configuration/flag/#repeatable
154
+ url: https://bashly.dev/configuration/flag/#repeatable
155
155
  example: |-
156
156
  flags:
157
157
  - long: --data
@@ -168,7 +168,7 @@ flag.repeatable:
168
168
 
169
169
  flag.required:
170
170
  help: Specify that this flag is required.
171
- url: https://bashly.dannyb.co/configuration/flag/#required
171
+ url: https://bashly.dev/configuration/flag/#required
172
172
  example: |-
173
173
  args:
174
174
  - long: --user
@@ -178,7 +178,7 @@ flag.required:
178
178
 
179
179
  flag.short:
180
180
  help: Specify the short form of the flag, including the - prefix. Either `long` or `short` is required.
181
- url: https://bashly.dannyb.co/configuration/flag/#short
181
+ url: https://bashly.dev/configuration/flag/#short
182
182
  example: |-
183
183
  - long: --user
184
184
  short: -u
@@ -187,7 +187,7 @@ flag.short:
187
187
 
188
188
  flag.unique:
189
189
  help: Specify that the arguments provided by this repeatable flag must be unique. When this is set to `true`, non-unique values will be ignored.
190
- url: https://bashly.dannyb.co/configuration/flag/#unique
190
+ url: https://bashly.dev/configuration/flag/#unique
191
191
  example: |-
192
192
  flags:
193
193
  - long: --path
@@ -199,7 +199,7 @@ flag.unique:
199
199
  flag.validate:
200
200
  help: Apply custom validation functions. Must be accompanied by `arg`.
201
201
 
202
- url: https://bashly.dannyb.co/configuration/flag/#validate
202
+ url: https://bashly.dev/configuration/flag/#validate
203
203
  example: |-
204
204
  flags:
205
205
  - long: --config
@@ -1,6 +1,6 @@
1
1
  variable:
2
2
  help: Define variables that will be available to your script.
3
- url: https://bashly.dannyb.co/configuration/variable/
3
+ url: https://bashly.dev/configuration/variable/
4
4
  example: |-
5
5
  variables:
6
6
  # Simple value
@@ -21,7 +21,7 @@ variable:
21
21
 
22
22
  variable.name:
23
23
  help: Specify the name of the variable.
24
- url: https://bashly.dannyb.co/configuration/variable/#name
24
+ url: https://bashly.dev/configuration/variable/#name
25
25
  example: |-
26
26
  variables:
27
27
  - name: output_folder
@@ -31,7 +31,7 @@ variable.value:
31
31
  help: |-
32
32
  Specify the value for this variable.
33
33
  This can be any value type, including array and hash (associative array).
34
- url: https://bashly.dannyb.co/configuration/variable/#value
34
+ url: https://bashly.dev/configuration/variable/#value
35
35
  example: |-
36
36
  variables:
37
37
  # Simple value
@@ -10,10 +10,21 @@
10
10
  ## Color output will be disabled if `NO_COLOR` environment variable is set
11
11
  ## in compliance with https://no-color.org/
12
12
  ##
13
+ ## In case you wish to enable auto detection for color output based on the
14
+ ## terminal being interactive (TTY), call `enable_auto_colors` in your
15
+ ## `src/initialize.sh` (Run `bashly add hooks` to add this file).
16
+ ##
17
+ enable_auto_colors() {
18
+ ## If NO_COLOR has not been set and stdout is not a TTY, disable colors
19
+ if [[ -z ${NO_COLOR+x} && ! -t 1 ]]; then
20
+ NO_COLOR=1
21
+ fi
22
+ }
23
+
13
24
  print_in_color() {
14
25
  local color="$1"
15
26
  shift
16
- if [[ -z ${NO_COLOR+x} ]]; then
27
+ if [[ "${NO_COLOR:-}" == "" ]]; then
17
28
  printf "$color%b\e[0m\n" "$*"
18
29
  else
19
30
  printf "%b\n" "$*"
@@ -3,6 +3,14 @@ colors:
3
3
  files:
4
4
  - source: "colors/colors.sh"
5
5
  target: "%{user_lib_dir}/colors.%{user_ext}"
6
+ post_install_message: |
7
+ The colors library supports the g`NO_COLOR` standard out of the box.
8
+
9
+ In case you wish to also enable automatic output of colors based on the
10
+ terminal being interactive (TTY), call g`enable_auto_colors` in your
11
+ g`src/initialize.sh`. You may run the following command to add this file:
12
+
13
+ m`$ bashly add hooks`
6
14
 
7
15
  completions:
8
16
  help: Generate a bash completions function.
@@ -17,7 +17,7 @@ module Bashly
17
17
  alias args catch_all commands completions
18
18
  default dependencies environment_variables examples
19
19
  extensible expose filename filters flags
20
- footer function group help name
20
+ footer function group help help_header_override name
21
21
  private variables version
22
22
  ]
23
23
  end
@@ -1,3 +1,3 @@
1
1
  module Bashly
2
- VERSION = '1.2.8'
2
+ VERSION = '1.2.10'
3
3
  end
@@ -1,12 +1,16 @@
1
1
  = view_marker
2
2
 
3
3
  > {{ function_name }}_usage() {
4
- if summary == help
4
+ if summary == help && !help_header_override
5
5
  > printf "{{ caption_string.sanitize_for_print }}\n\n"
6
6
  else
7
7
  > if [[ -n $long_usage ]]; then
8
- > printf "{{ full_name }}\n\n"
9
- > printf "{{ help.wrap(78).indent(2).sanitize_for_print }}\n\n"
8
+ if help_header_override
9
+ = help_header_override.indent 4
10
+ else
11
+ > printf "{{ full_name }}\n\n"
12
+ > printf "{{ help.wrap(78).indent(2).sanitize_for_print }}\n\n"
13
+ end
10
14
  > else
11
15
  > printf "{{ caption_string.sanitize_for_print }}\n\n"
12
16
  > fi
@@ -1,6 +1,6 @@
1
1
  > #!/usr/bin/env bash
2
2
  if Settings.enabled? :header_comment
3
- > # This script was generated by bashly {{ Bashly::VERSION }} (https://bashly.dannyb.co)
3
+ > # This script was generated by bashly {{ Bashly::VERSION }} (https://bashly.dev)
4
4
  > # Modifying it manually is not recommended
5
5
  end
6
6
  >
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bashly
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.8
4
+ version: 1.2.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Ben Shitrit
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-01-16 00:00:00.000000000 Z
10
+ date: 2025-02-22 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: colsole
@@ -345,7 +345,7 @@ licenses:
345
345
  metadata:
346
346
  bug_tracker_uri: https://github.com/DannyBen/bashly/issues
347
347
  changelog_uri: https://github.com/DannyBen/bashly/blob/master/CHANGELOG.md
348
- homepage_uri: https://bashly.dannyb.co/
348
+ homepage_uri: https://bashly.dev/
349
349
  source_code_uri: https://github.com/DannyBen/bashly
350
350
  rubygems_mfa_required: 'true'
351
351
  rdoc_options: []
@@ -362,7 +362,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
362
362
  - !ruby/object:Gem::Version
363
363
  version: '0'
364
364
  requirements: []
365
- rubygems_version: 3.6.2
365
+ rubygems_version: 3.6.3
366
366
  specification_version: 4
367
367
  summary: Bash Command Line Tool Generator
368
368
  test_files: []