bashly 0.5.0 → 0.5.1

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: 6b573ae52d9c93016675adc209eeb011d3f6897791b0e159e25af5a76e7290d6
4
- data.tar.gz: 69b99fb9b6729dd21d748688c11041130f3e35852212d148afe8af715b13804f
3
+ metadata.gz: ca34648c628c4e7fe167d5f5b0d253792e9b4d3c494b253ed68d0127e4935572
4
+ data.tar.gz: 5247da7780a8424dd0a808ace6d182ed4284597e094122d94a8716bfca8f343b
5
5
  SHA512:
6
- metadata.gz: f624d54df411325e3b4b6c8446a56d6e6bbd22e9caa2310c13d4c9d254920f84db1f19684355255374cbfa41653020a9f9d848acfa97afb88d76e448928f00d7
7
- data.tar.gz: 1a98f13669d2de4a9b092afba7fdaebff16c0647a41ccf1696b6abdcda114661e6fb9995cfba1e0da348e30c79a9ae0777078bff3fc8a82cdcfd650c152c528b
6
+ metadata.gz: 2145d1f4125d762c3d583f560c4caa9f4b98cfc2500e7e7b9ac977f4284a190a150a26da6e935c4e59c689f5efcd627924a10091cff0d4d91f00c3f60d26b943
7
+ data.tar.gz: 9df4695f43e4c57371f876de1dee3eab587bb227b7b0ee51d52d1772faf119cbd59cb117f5a1e3cbb06ef49b5796cd02b6fecba685b733aa35c51442fe9baf19
data/README.md CHANGED
@@ -15,6 +15,7 @@ Create beautiful bash scripts from simple YAML configuration
15
15
 
16
16
  </div>
17
17
 
18
+
18
19
  ## Table of Contents
19
20
 
20
21
  - [Table of Contents](#table-of-contents)
@@ -24,19 +25,18 @@ Create beautiful bash scripts from simple YAML configuration
24
25
  - [Usage](#usage)
25
26
  - [Using the input arguments in your code](#using-the-input-arguments-in-your-code)
26
27
  - [Examples](#examples)
27
- - [Sample configuration for a script without commands](#sample-configuration-for-a-script-without-commands)
28
- - [Sample configuration for a script with commands](#sample-configuration-for-a-script-with-commands)
29
28
  - [Configuration Reference](#configuration-reference)
30
29
  - [Command options](#command-options)
31
30
  - [Argument options](#argument-options)
32
31
  - [Flag options](#flag-options)
33
32
  - [Environment Variable options](#environment-variable-options)
34
- - [Extensible Commands](#extensible-commands)
33
+ - [Extensible Scripts](#extensible-scripts)
35
34
  - [Real World Examples](#real-world-examples)
36
35
  - [Contributing / Support](#contributing--support)
37
36
 
38
37
  ---
39
38
 
39
+
40
40
  ## Installation
41
41
 
42
42
  ```shell
@@ -84,8 +84,17 @@ Bahsly is responsible for:
84
84
  - **YAML parsing**.
85
85
  - and more.
86
86
 
87
+
87
88
  ## Usage
88
89
 
90
+ The `bashly.yml` file can be set up to generate two types of scripts:
91
+
92
+ 1. Script with commands (for example, like `docker` or `git`).
93
+ 2. Script without commands (for example, like `ls`)
94
+
95
+ This is detected automatically by the contents of the configuration: If it
96
+ contains a `commands` definition, it will generate a script with commands.
97
+
89
98
  In an empty directory, create a sample configuration file by running
90
99
 
91
100
  ```shell
@@ -153,32 +162,11 @@ $ ./download a --force
153
162
  downloading a with --force
154
163
  ```
155
164
 
156
- ## Examples
157
165
 
158
- The `bashly.yml` file can be set up to generate two types of scripts:
159
-
160
- 1. Script with commands (for example, like `docker` or `git`).
161
- 2. Script without commands (for example, like `ls`)
162
-
163
- This is detected automatically by the contents of the configuration: If it
164
- contains a `commands` definition, it will generate a script with commands.
165
-
166
-
167
- ### Sample configuration for a script without commands
168
-
169
- - Generate this script by running `bashly generate --minimal`
170
- - [See the initial sample bashly.yml file](examples/minimal/src/bashly.yml)
171
- - [See the generated bash script](examples/minimal/download)
172
-
173
- ### Sample configuration for a script with commands
174
-
175
- - Generate this script by running `bashly generate`
176
- - [See the initial sample bashly.yml file](examples/commands/src/bashly.yml)
177
- - [See the generated bash script](examples/commands/cli)
178
-
179
-
180
- See the [examples](examples) folder for more examples.
166
+ ## Examples
181
167
 
168
+ The [examples folder](examples#readme) contains many detailed and documented
169
+ example configuration files, with their output.
182
170
 
183
171
 
184
172
  ## Configuration Reference
@@ -204,7 +192,7 @@ command and subcommands (under the `commands` definition).
204
192
  `help` | The header text to display when using `--help`. This option can have multiple lines. In this case, the first line will be used as summary wherever appropriate.
205
193
  `version` | The string to display when using `--version`. *Applicable only in the main command*.
206
194
  `default` | Setting this to `true` on any command, will cause any unrecognized command line to be passed to this command. *Applicable only in subcommands*.
207
- `extensible` | Specify that this command can be [externally extended](#extensible-commands).
195
+ `extensible` | Specify that this command can be [externally extended](#extensible-scripts). *Applicable only in the main command*.
208
196
  `examples` | Specify an array of examples to show when using `--help`. Each example can have multiple lines.
209
197
  `environment_variables` | Specify an array of [environment variables](#environment-variable-options) needed by your script.
210
198
  `commands` | Specify the array of [commands](#command-options). Each command will have its own args and flags. Note: if `commands` is provided, you cannot specify flags or args at the same level.
@@ -213,6 +201,7 @@ command and subcommands (under the `commands` definition).
213
201
  `catch_all` | Specify that this command should allow for additional arbitrary arguments or flags. It can be set in one of three ways:<br>- Set to `true` to just enable it.<br>- Set to a string, to use this string in the usage help text.<br>- Set to a hash containing `label` and `help` keys, to show a detailed help for it when running with `--help`.
214
202
  `dependencies` | Specify an array of any required external dependencies (commands). The script execution will be halted with a friendly error unless all dependency commands exist.
215
203
  `group` | In case you have many commands, use this option to specify a caption to display before this command. This option is purely for display purposes, and needs to be specified only for the first command in each group.
204
+ `footer` | Add a custom message that will be displayed at the end of the `--help` text.
216
205
 
217
206
  ### Argument options
218
207
 
@@ -249,9 +238,7 @@ The `-v` and `-h` flags will be used as the short options for `--version` and
249
238
  `--help` respectively **only if you are not using them in any of your own
250
239
  flags**.
251
240
 
252
- ### Environment Variable options
253
-
254
- The below configuration generates this environment variable usage text:
241
+ ### Environment variable options
255
242
 
256
243
  If an environment variable is defined as required (false by default), the
257
244
  execution of the script will be halted with a friendly error if it is not
@@ -264,7 +251,7 @@ set.
264
251
  `required` | Specify if this variable is required.
265
252
 
266
253
 
267
- ## Extensible Commands
254
+ ## Extensible Scripts
268
255
 
269
256
  You may configure your generated bash script to delegate any unknown command
270
257
  to an external executable, by setting the `extensible` option to either `true`,
@@ -339,7 +326,6 @@ The generated script will execute `git status`.
339
326
  See the [extensible-delegate example](examples/extensible-delegate).
340
327
 
341
328
 
342
-
343
329
  ## Real World Examples
344
330
 
345
331
  - [Rush][rush] - a Personal Package Manager
@@ -16,6 +16,7 @@ module Bashly
16
16
  examples
17
17
  extensible
18
18
  flags
19
+ footer
19
20
  group
20
21
  help
21
22
  long
@@ -1,3 +1,3 @@
1
1
  module Bashly
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
@@ -0,0 +1,2 @@
1
+ printf "<%= footer.gsub("\n", '\n').gsub('"', '\"') %>\n"
2
+ echo
@@ -40,6 +40,7 @@
40
40
  <%= render(:usage_args).indent 4 if args.any? or catch_all_help %>
41
41
  <%= render(:usage_environment_variables).indent 4 if environment_variables.any? %>
42
42
  <%= render(:usage_examples).indent 4 if examples %>
43
+ <%= render(:footer).indent 4 if footer %>
43
44
 
44
45
  fi
45
46
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bashly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Ben Shitrit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-30 00:00:00.000000000 Z
11
+ date: 2021-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colsole
@@ -102,6 +102,7 @@ files:
102
102
  - lib/bashly/views/command/dependencies_filter.erb
103
103
  - lib/bashly/views/command/environment_variables_filter.erb
104
104
  - lib/bashly/views/command/fixed_flags_filter.erb
105
+ - lib/bashly/views/command/footer.erb
105
106
  - lib/bashly/views/command/function.erb
106
107
  - lib/bashly/views/command/initialize.erb
107
108
  - lib/bashly/views/command/inspect_args.erb