You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/bashly/commands/add.rb
+37-10Lines changed: 37 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -16,25 +16,49 @@ class Add < Base
16
16
17
17
option'-f --force','Overwrite existing files'
18
18
19
-
param'FORMAT',"Output format, can be one of:\n function : generate a function file to be included in your script.\n script : generate a standalone bash completions script.\n yaml : generate a yaml compatible with completely."
20
-
param'OUTPUT',"For the 'comp function' command: Name of the generated function.\nFor the 'comp script' or 'comp yaml' commands: path to output file.\nIn all cases, this is optional and will have sensible defaults."
19
+
param'FORMAT',<<~USAGE
20
+
Output format, can be one of:
21
+
function : generate a function file to be included in your script.
22
+
script : generate a standalone bash completions script.
23
+
yaml : generate a yaml compatible with completely.
24
+
USAGE
25
+
26
+
param'OUTPUT',<<~USAGE
27
+
For the 'comp function' command: Name of the generated function.
28
+
For the 'comp script' or 'comp yaml' commands: path to output file.
29
+
In all cases, this is optional and will have sensible defaults.
30
+
USAGE
31
+
32
+
command'colors',
33
+
'Add standard functions for printing colorful and formatted text to the ' \
34
+
'lib directory.'
21
35
22
-
command'colors','Add standard functions for printing colorful and formatted text to the lib directory.'
23
36
command'comp','Generate a bash completions script or function.'
24
37
command'config','Add standard functions for handling INI files to the lib directory.'
25
-
command'lib','Create the additional lib directory for additional user scripts. All *.sh scripts in this folder will be included in the final bash script.'
26
-
command'settings','Copy a sample settings.yml file to your project, allowing you to customize some bashly options.'
27
-
command'strings','Copy an additional configuration file to your project, allowing you to customize all the tips and error strings.'
38
+
command'lib',
39
+
'Create the additional lib directory for additional user scripts. ' \
40
+
'All *.sh scripts in this folder will be included in the final bash script.'
41
+
42
+
command'settings',
43
+
'Copy a sample settings.yml file to your project, ' \
44
+
'allowing you to customize some bashly options.'
45
+
46
+
command'strings',
47
+
'Copy an additional configuration file to your project, ' \
48
+
'allowing you to customize all the tips and error strings.'
49
+
28
50
command'test','Add approval testing.'
29
51
command'validations','Add argument validation functions to the lib directory.'
30
52
command'yaml','Add standard functions for reading YAML files to the lib directory.'
31
-
32
53
example'bashly add strings --force'
33
54
example'bashly add comp function'
34
55
example'bashly add comp script completions.bash'
35
56
36
-
environment'BASHLY_SOURCE_DIR','The path containing the bashly configuration and source files [default: src]'
37
-
environment'BASHLY_LIB_DIR','The path to use for creating the library files, relative to the source dir [default: lib]'
57
+
environment'BASHLY_SOURCE_DIR',
58
+
'The path containing the bashly configuration and source files [default: src]'
59
+
60
+
environment'BASHLY_LIB_DIR',
61
+
'The path to use for creating the library files, relative to the source dir [default: lib]'
38
62
39
63
attr_reader:skip_src_check
40
64
@@ -98,7 +122,10 @@ def add_lib(name, *args)
98
122
99
123
defsafe_write(path,content)
100
124
if !skip_src_check && !Dir.exist?(Settings.source_dir)
101
-
raiseInitError,"Directory !txtgrn!#{Settings.source_dir}!txtrst! does not exist\nRun !txtpur!bashly init!txtrst! first"
125
+
raiseInitError,<<~ERROR
126
+
Directory !txtgrn!#{Settings.source_dir}!txtrst! does not exist
Copy file name to clipboardExpand all lines: lib/bashly/commands/generate.rb
+12-4Lines changed: 12 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -15,11 +15,18 @@ class Generate < Base
15
15
option'-r --wrap FUNCTION','Wrap the entire script in a function so it can also be sourced'
16
16
option'-e --env ENV','Force the generation environment (see BASHLY_ENV)'
17
17
18
-
environment'BASHLY_SOURCE_DIR','The path containing the bashly configuration and source files [default: src]'
18
+
environment'BASHLY_SOURCE_DIR','The path containing the bashly configuration and source ' \
19
+
'files [default: src]'
20
+
19
21
environment'BASHLY_TARGET_DIR','The path to use for creating the bash script [default: .]'
20
-
environment'BASHLY_LIB_DIR','The path to use for upgrading library files, relative to the source dir [default: lib]'
22
+
environment'BASHLY_LIB_DIR',
23
+
'The path to use for upgrading library files, relative to the source dir [default: lib]'
24
+
21
25
environment'BASHLY_STRICT','When not empty, enable bash strict mode (set -euo pipefail)'
22
-
environment'BASHLY_TAB_INDENT','When not empty, the generated script will use tab indentation instead of spaces (every 2 leading spaces will be converted to a tab character)'
26
+
environment'BASHLY_TAB_INDENT',
27
+
'When not empty, the generated script will use tab indentation instead of spaces ' \
28
+
'(every 2 leading spaces will be converted to a tab character)'
29
+
23
30
environment'BASHLY_ENV',<<~HELP
24
31
Set to 'production' or 'development':
25
32
- production generate a smaller script, without file markers
Copy file name to clipboardExpand all lines: lib/bashly/commands/validate.rb
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -6,9 +6,13 @@ class Validate < Base
6
6
usage'bashly validate [--verbose]'
7
7
usage'bashly validate (-h|--help)'
8
8
9
-
option'-v --verbose','Show the bashly configuration file prior to validating. This is useful when using split config (import) since it will show the final compiled configuration.'
9
+
option'-v --verbose',
10
+
'Show the bashly configuration file prior to validating. ' \
11
+
'This is useful when using split config (import) since it will show ' \
12
+
'the final compiled configuration.'
10
13
11
-
environment'BASHLY_SOURCE_DIR','The path containing the bashly configuration and source files [default: src]'
14
+
environment'BASHLY_SOURCE_DIR',
15
+
'The path containing the bashly configuration and source files [default: src]'
0 commit comments