bashly 1.3.7 → 1.4.0.rc1
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 +4 -4
- data/lib/bashly/commands/doc.rb +1 -1
- data/lib/bashly/completion_builder.rb +188 -0
- data/lib/bashly/completions/bashly-completions.bash +482 -78
- data/lib/bashly/completions/completely.yaml +141 -155
- data/lib/bashly/completions/completely.yaml.gtx +62 -75
- data/lib/bashly/concerns/completions.rb +9 -46
- data/lib/bashly/config_validator.rb +3 -0
- data/lib/bashly/docs/arg.yml +11 -0
- data/lib/bashly/extensions/yaml.rb +12 -5
- data/lib/bashly/libraries/libraries.yml +15 -0
- data/lib/bashly/libraries/settings/settings.yml +6 -0
- data/lib/bashly/library_source_config.rb +1 -1
- data/lib/bashly/message_strings.rb +2 -2
- data/lib/bashly/script/argument.rb +1 -1
- data/lib/bashly/script/dependency.rb +1 -1
- data/lib/bashly/script/introspection/commands.rb +0 -5
- data/lib/bashly/settings.rb +5 -0
- data/lib/bashly/version.rb +1 -1
- data/lib/bashly/views/command/argfile_filter.gtx +26 -2
- data/lib/bashly/views/command/master_script.gtx +0 -1
- data/lib/bashly/views/command/parse_requirements.gtx +1 -1
- data/lib/bashly/views/flag/argfile_case.gtx +6 -0
- data/lib/bashly/views/flag/argfile_case_arg.gtx +23 -0
- data/lib/bashly/views/flag/argfile_case_no_arg.gtx +7 -0
- data/lib/bashly.rb +3 -2
- metadata +8 -5
- data/lib/bashly/views/command/argfile_helpers.gtx +0 -36
|
@@ -1,155 +1,141 @@
|
|
|
1
|
-
|
|
2
|
-
-
|
|
3
|
-
-
|
|
4
|
-
-
|
|
5
|
-
-
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
- --
|
|
17
|
-
|
|
18
|
-
- --
|
|
19
|
-
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
- --
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
- --
|
|
31
|
-
-
|
|
32
|
-
- --
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
-
|
|
40
|
-
- --
|
|
41
|
-
|
|
42
|
-
- --
|
|
43
|
-
- --
|
|
44
|
-
- --
|
|
45
|
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
- development
|
|
57
|
-
- production
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
-
|
|
68
|
-
-
|
|
69
|
-
-
|
|
70
|
-
-
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
-
|
|
74
|
-
-
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
79
|
-
|
|
80
|
-
-
|
|
81
|
-
-
|
|
82
|
-
-
|
|
83
|
-
-
|
|
84
|
-
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
-
|
|
90
|
-
-
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
-
|
|
94
|
-
-
|
|
95
|
-
-
|
|
96
|
-
-
|
|
97
|
-
-
|
|
98
|
-
-
|
|
99
|
-
-
|
|
100
|
-
-
|
|
101
|
-
- command
|
|
102
|
-
- command.
|
|
103
|
-
- command.
|
|
104
|
-
- command.
|
|
105
|
-
- command.
|
|
106
|
-
- command.
|
|
107
|
-
- command.
|
|
108
|
-
- command.
|
|
109
|
-
- command.
|
|
110
|
-
- command.
|
|
111
|
-
- command.
|
|
112
|
-
- command.
|
|
113
|
-
-
|
|
114
|
-
-
|
|
115
|
-
-
|
|
116
|
-
-
|
|
117
|
-
-
|
|
118
|
-
-
|
|
119
|
-
-
|
|
120
|
-
-
|
|
121
|
-
-
|
|
122
|
-
-
|
|
123
|
-
-
|
|
124
|
-
-
|
|
125
|
-
-
|
|
126
|
-
-
|
|
127
|
-
-
|
|
128
|
-
-
|
|
129
|
-
- flag
|
|
130
|
-
- flag.
|
|
131
|
-
- flag.
|
|
132
|
-
- flag.
|
|
133
|
-
- flag.
|
|
134
|
-
- flag.
|
|
135
|
-
-
|
|
136
|
-
-
|
|
137
|
-
-
|
|
138
|
-
|
|
139
|
-
-
|
|
140
|
-
-
|
|
141
|
-
-
|
|
142
|
-
|
|
143
|
-
bashly completions: &completions
|
|
144
|
-
- --help
|
|
145
|
-
- -h
|
|
146
|
-
- --install
|
|
147
|
-
- -i
|
|
148
|
-
|
|
149
|
-
bashly c: *completions
|
|
150
|
-
|
|
151
|
-
bashly shell: &shell
|
|
152
|
-
- --help
|
|
153
|
-
- -h
|
|
154
|
-
|
|
155
|
-
bashly s: *shell
|
|
1
|
+
patterns:
|
|
2
|
+
- bashly [root options]
|
|
3
|
+
- bashly init|i [init options]
|
|
4
|
+
- bashly preview|p [preview options]
|
|
5
|
+
- bashly validate|v [validate options]
|
|
6
|
+
- bashly generate|build|g [generate options]
|
|
7
|
+
- bashly add|a [add options] <library>
|
|
8
|
+
- bashly doc [doc options] <doc>
|
|
9
|
+
- bashly completions|c [completions options]
|
|
10
|
+
- bashly render [render options] <render_source>
|
|
11
|
+
- bashly shell|s [shell options]
|
|
12
|
+
|
|
13
|
+
options:
|
|
14
|
+
root:
|
|
15
|
+
- --help|-h
|
|
16
|
+
- --version|-v
|
|
17
|
+
init:
|
|
18
|
+
- --help|-h
|
|
19
|
+
- --minimal|-m
|
|
20
|
+
preview:
|
|
21
|
+
- --help|-h
|
|
22
|
+
validate:
|
|
23
|
+
- --help|-h
|
|
24
|
+
- --verbose|-v
|
|
25
|
+
generate:
|
|
26
|
+
- --help|-h
|
|
27
|
+
- --env|-e <env>
|
|
28
|
+
- --force|-f
|
|
29
|
+
- --quiet|-q
|
|
30
|
+
- --upgrade|-u
|
|
31
|
+
- --watch|-w
|
|
32
|
+
- --wrap|-r <function>
|
|
33
|
+
add:
|
|
34
|
+
- --help|-h
|
|
35
|
+
- --force|-f
|
|
36
|
+
- --list|-l
|
|
37
|
+
- --source|-s <source>
|
|
38
|
+
doc:
|
|
39
|
+
- --help|-h
|
|
40
|
+
- --index|-i
|
|
41
|
+
completions:
|
|
42
|
+
- --help|-h
|
|
43
|
+
- --install|-i
|
|
44
|
+
- --uninstall|-u
|
|
45
|
+
render:
|
|
46
|
+
- --help|-h
|
|
47
|
+
- --watch|-w
|
|
48
|
+
- --show|-s <path>
|
|
49
|
+
- --list|-l
|
|
50
|
+
- --about|-a
|
|
51
|
+
shell:
|
|
52
|
+
- --help|-h
|
|
53
|
+
|
|
54
|
+
tokens:
|
|
55
|
+
env:
|
|
56
|
+
- development
|
|
57
|
+
- production
|
|
58
|
+
function:
|
|
59
|
+
source:
|
|
60
|
+
path:
|
|
61
|
+
library:
|
|
62
|
+
- colors
|
|
63
|
+
- completions
|
|
64
|
+
- completions_script
|
|
65
|
+
- completions_yaml
|
|
66
|
+
- config
|
|
67
|
+
- help
|
|
68
|
+
- hooks
|
|
69
|
+
- ini
|
|
70
|
+
- lib
|
|
71
|
+
- render_markdown
|
|
72
|
+
- render_markdown_github
|
|
73
|
+
- render_mandoc
|
|
74
|
+
- settings
|
|
75
|
+
- stacktrace
|
|
76
|
+
- strings
|
|
77
|
+
- validations
|
|
78
|
+
- yaml
|
|
79
|
+
doc:
|
|
80
|
+
- arg
|
|
81
|
+
- arg.allowed
|
|
82
|
+
- arg.completions
|
|
83
|
+
- arg.default
|
|
84
|
+
- arg.help
|
|
85
|
+
- arg.name
|
|
86
|
+
- arg.repeatable
|
|
87
|
+
- arg.required
|
|
88
|
+
- arg.validate
|
|
89
|
+
- command
|
|
90
|
+
- command.alias
|
|
91
|
+
- command.args
|
|
92
|
+
- command.catch_all
|
|
93
|
+
- command.commands
|
|
94
|
+
- command.completions
|
|
95
|
+
- command.default
|
|
96
|
+
- command.dependencies
|
|
97
|
+
- command.environment_variables
|
|
98
|
+
- command.examples
|
|
99
|
+
- command.expose
|
|
100
|
+
- command.extensible
|
|
101
|
+
- command.filename
|
|
102
|
+
- command.filters
|
|
103
|
+
- command.flags
|
|
104
|
+
- command.footer
|
|
105
|
+
- command.function
|
|
106
|
+
- command.group
|
|
107
|
+
- command.help
|
|
108
|
+
- command.help_header_override
|
|
109
|
+
- command.name
|
|
110
|
+
- command.private
|
|
111
|
+
- command.variables
|
|
112
|
+
- command.version
|
|
113
|
+
- environment_variable
|
|
114
|
+
- environment_variable.default
|
|
115
|
+
- environment_variable.help
|
|
116
|
+
- environment_variable.name
|
|
117
|
+
- environment_variable.private
|
|
118
|
+
- environment_variable.required
|
|
119
|
+
- environment_variable.validate
|
|
120
|
+
- flag
|
|
121
|
+
- flag.allowed
|
|
122
|
+
- flag.arg
|
|
123
|
+
- flag.completions
|
|
124
|
+
- flag.conflicts
|
|
125
|
+
- flag.default
|
|
126
|
+
- flag.help
|
|
127
|
+
- flag.long
|
|
128
|
+
- flag.needs
|
|
129
|
+
- flag.private
|
|
130
|
+
- flag.repeatable
|
|
131
|
+
- flag.required
|
|
132
|
+
- flag.short
|
|
133
|
+
- flag.unique
|
|
134
|
+
- flag.validate
|
|
135
|
+
- variable
|
|
136
|
+
- variable.name
|
|
137
|
+
- variable.value
|
|
138
|
+
render_source:
|
|
139
|
+
- ":mandoc"
|
|
140
|
+
- ":markdown"
|
|
141
|
+
- ":markdown_github"
|
|
@@ -1,85 +1,72 @@
|
|
|
1
|
-
>
|
|
1
|
+
> patterns:
|
|
2
|
+
> - bashly [root options]
|
|
3
|
+
> - bashly init|i [init options]
|
|
4
|
+
> - bashly preview|p [preview options]
|
|
5
|
+
> - bashly validate|v [validate options]
|
|
6
|
+
> - bashly generate|build|g [generate options]
|
|
7
|
+
> - bashly add|a [add options] <library>
|
|
8
|
+
> - bashly doc [doc options] <doc>
|
|
9
|
+
> - bashly completions|c [completions options]
|
|
10
|
+
> - bashly render [render options] <render_source>
|
|
11
|
+
> - bashly shell|s [shell options]
|
|
12
|
+
>
|
|
13
|
+
> options:
|
|
14
|
+
> root:
|
|
2
15
|
= help_flags
|
|
3
|
-
>
|
|
4
|
-
>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
>
|
|
16
|
+
> - --version|-v
|
|
17
|
+
> init:
|
|
18
|
+
= help_flags
|
|
19
|
+
> - --minimal|-m
|
|
20
|
+
> preview:
|
|
21
|
+
= help_flags
|
|
22
|
+
> validate:
|
|
10
23
|
= help_flags
|
|
11
|
-
>
|
|
12
|
-
>
|
|
13
|
-
>
|
|
14
|
-
> bashly i: *init
|
|
15
|
-
>
|
|
16
|
-
> bashly preview: &preview
|
|
24
|
+
> - --verbose|-v
|
|
25
|
+
> generate:
|
|
17
26
|
= help_flags
|
|
18
|
-
>
|
|
19
|
-
>
|
|
20
|
-
>
|
|
21
|
-
>
|
|
27
|
+
> - --env|-e <env>
|
|
28
|
+
> - --force|-f
|
|
29
|
+
> - --quiet|-q
|
|
30
|
+
> - --upgrade|-u
|
|
31
|
+
> - --watch|-w
|
|
32
|
+
> - --wrap|-r <function>
|
|
33
|
+
> add:
|
|
22
34
|
= help_flags
|
|
23
|
-
>
|
|
24
|
-
>
|
|
25
|
-
>
|
|
26
|
-
>
|
|
27
|
-
>
|
|
28
|
-
> bashly generate: &generate
|
|
35
|
+
> - --force|-f
|
|
36
|
+
> - --list|-l
|
|
37
|
+
> - --source|-s <source>
|
|
38
|
+
> doc:
|
|
29
39
|
= help_flags
|
|
30
|
-
>
|
|
31
|
-
>
|
|
32
|
-
> - --quiet
|
|
33
|
-
> - --upgrade
|
|
34
|
-
> - --watch
|
|
35
|
-
> - --wrap
|
|
36
|
-
> - -e
|
|
37
|
-
> - -f
|
|
38
|
-
> - -q
|
|
39
|
-
> - -r
|
|
40
|
-
> - -u
|
|
41
|
-
> - -w
|
|
42
|
-
>
|
|
43
|
-
> bashly g: *generate
|
|
44
|
-
>
|
|
45
|
-
> bashly generate*--env: &env
|
|
46
|
-
> - development
|
|
47
|
-
> - production
|
|
48
|
-
>
|
|
49
|
-
> bashly generate*-e: *env
|
|
50
|
-
> bashly g*--env: *env
|
|
51
|
-
> bashly g*-e: *env
|
|
52
|
-
>
|
|
53
|
-
> bashly add: &add
|
|
40
|
+
> - --index|-i
|
|
41
|
+
> completions:
|
|
54
42
|
= help_flags
|
|
55
|
-
>
|
|
56
|
-
>
|
|
57
|
-
>
|
|
58
|
-
|
|
59
|
-
>
|
|
60
|
-
>
|
|
43
|
+
> - --install|-i
|
|
44
|
+
> - --uninstall|-u
|
|
45
|
+
> render:
|
|
46
|
+
= help_flags
|
|
47
|
+
> - --watch|-w
|
|
48
|
+
> - --show|-s <path>
|
|
49
|
+
> - --list|-l
|
|
50
|
+
> - --about|-a
|
|
51
|
+
> shell:
|
|
52
|
+
= help_flags
|
|
53
|
+
>
|
|
54
|
+
> tokens:
|
|
55
|
+
> env:
|
|
56
|
+
> - development
|
|
57
|
+
> - production
|
|
58
|
+
> function:
|
|
59
|
+
> source:
|
|
60
|
+
> path:
|
|
61
|
+
> library:
|
|
61
62
|
libs.each do |lib|
|
|
62
|
-
= "- #{lib}"
|
|
63
|
+
= " - #{lib}"
|
|
63
64
|
end
|
|
64
|
-
>
|
|
65
|
-
> bashly a: *add
|
|
66
|
-
>
|
|
67
|
-
> bashly doc: &doc
|
|
68
|
-
= help_flags
|
|
69
|
-
> - --index
|
|
70
|
-
> - -i
|
|
65
|
+
> doc:
|
|
71
66
|
docs.each do |doc|
|
|
72
|
-
= "- #{doc}"
|
|
67
|
+
= " - #{doc}"
|
|
68
|
+
end
|
|
69
|
+
> render_source:
|
|
70
|
+
render_sources.each do |source|
|
|
71
|
+
= " - #{source.inspect}"
|
|
73
72
|
end
|
|
74
|
-
>
|
|
75
|
-
> bashly completions: &completions
|
|
76
|
-
= help_flags
|
|
77
|
-
> - --install
|
|
78
|
-
> - -i
|
|
79
|
-
>
|
|
80
|
-
> bashly c: *completions
|
|
81
|
-
>
|
|
82
|
-
> bashly shell: &shell
|
|
83
|
-
= help_flags
|
|
84
|
-
>
|
|
85
|
-
> bashly s: *shell
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
require 'completely'
|
|
2
|
+
require 'bashly/completion_builder'
|
|
2
3
|
|
|
3
4
|
module Bashly
|
|
4
5
|
# This is a `Command` and `Flag` concern responsible for providing bash
|
|
@@ -15,25 +16,18 @@ module Bashly
|
|
|
15
16
|
["#{prefix}#{name}", comps]
|
|
16
17
|
end
|
|
17
18
|
end
|
|
19
|
+
|
|
20
|
+
def completion_option_entry(token_name = nil)
|
|
21
|
+
result = [aliases.join('|')]
|
|
22
|
+
result << "<#{token_name}>" if token_name
|
|
23
|
+
result << '(repeatable)' if repeatable
|
|
24
|
+
result.join ' '
|
|
25
|
+
end
|
|
18
26
|
end
|
|
19
27
|
|
|
20
28
|
module Command
|
|
21
29
|
def completion_data(with_version: true)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
completion_full_names.each do |name|
|
|
25
|
-
name = "#{name}*" if name.include? '*'
|
|
26
|
-
result[name] = completion_words with_version: with_version
|
|
27
|
-
flags.each do |flag|
|
|
28
|
-
result.merge! flag.completion_data(name)
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
visible_commands.each do |command|
|
|
33
|
-
result.merge! command.completion_data(with_version: false)
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
result
|
|
30
|
+
CompletionBuilder.new(self, with_version: with_version).call
|
|
37
31
|
end
|
|
38
32
|
|
|
39
33
|
def completion_script
|
|
@@ -44,42 +38,11 @@ module Bashly
|
|
|
44
38
|
completion_generator.wrapper_function name
|
|
45
39
|
end
|
|
46
40
|
|
|
47
|
-
protected
|
|
48
|
-
|
|
49
|
-
def completion_full_names
|
|
50
|
-
if parent_command
|
|
51
|
-
glue = parent_command.global_flags? ? '*' : ' '
|
|
52
|
-
parent_command.completion_full_names.product(aliases).map { |a| a.join glue }
|
|
53
|
-
else
|
|
54
|
-
aliases
|
|
55
|
-
end
|
|
56
|
-
end
|
|
57
|
-
|
|
58
41
|
private
|
|
59
42
|
|
|
60
43
|
def completion_generator
|
|
61
44
|
Completely::Completions.new completion_data
|
|
62
45
|
end
|
|
63
|
-
|
|
64
|
-
def completion_flag_names
|
|
65
|
-
visible_flags.map(&:name) + visible_flags.map(&:short)
|
|
66
|
-
end
|
|
67
|
-
|
|
68
|
-
def completion_allowed_args
|
|
69
|
-
args.map(&:allowed).flatten
|
|
70
|
-
end
|
|
71
|
-
|
|
72
|
-
def completion_words(with_version: false)
|
|
73
|
-
trivial_flags = %w[--help -h]
|
|
74
|
-
trivial_flags += %w[--version -v] if with_version
|
|
75
|
-
all = (
|
|
76
|
-
visible_command_aliases + trivial_flags +
|
|
77
|
-
completion_flag_names + completion_allowed_args
|
|
78
|
-
)
|
|
79
|
-
|
|
80
|
-
all += completions if completions
|
|
81
|
-
all.compact.uniq.sort
|
|
82
|
-
end
|
|
83
46
|
end
|
|
84
47
|
end
|
|
85
48
|
end
|
|
@@ -90,6 +90,8 @@ module Bashly
|
|
|
90
90
|
|
|
91
91
|
def assert_arg(key, value)
|
|
92
92
|
assert_hash key, value, keys: Script::Argument.option_keys
|
|
93
|
+
refute value['allowed'] && value['completions'], "#{key} cannot have both nub`allowed` and nub`completions`"
|
|
94
|
+
|
|
93
95
|
assert_string "#{key}.name", value['name']
|
|
94
96
|
assert_optional_string "#{key}.help", value['help']
|
|
95
97
|
assert_string_or_array "#{key}.default", value['default']
|
|
@@ -99,6 +101,7 @@ module Bashly
|
|
|
99
101
|
assert_boolean "#{key}.unique", value['unique']
|
|
100
102
|
|
|
101
103
|
assert_array "#{key}.allowed", value['allowed'], of: :string
|
|
104
|
+
assert_array "#{key}.completions", value['completions'], of: :string
|
|
102
105
|
|
|
103
106
|
refute value['name'].match(/^-/), "#{key}.name must not start with '-'"
|
|
104
107
|
|
data/lib/bashly/docs/arg.yml
CHANGED
|
@@ -33,6 +33,17 @@ arg.allowed:
|
|
|
33
33
|
allowed: [stage, production, development]
|
|
34
34
|
default: development
|
|
35
35
|
|
|
36
|
+
arg.completions:
|
|
37
|
+
help: Specify a list of additional completion suggestions when used in conjunction with `bashly add completions`.
|
|
38
|
+
url: https://bashly.dev/configuration/argument/#completions
|
|
39
|
+
example: |-
|
|
40
|
+
args:
|
|
41
|
+
- name: path
|
|
42
|
+
help: File or directory to process
|
|
43
|
+
completions:
|
|
44
|
+
- <file>
|
|
45
|
+
- <directory>
|
|
46
|
+
|
|
36
47
|
arg.default:
|
|
37
48
|
help: Specify the value to apply when not provided by the user.
|
|
38
49
|
url: https://bashly.dev/configuration/argument/#default
|
|
@@ -2,14 +2,21 @@ require 'erb'
|
|
|
2
2
|
require 'yaml'
|
|
3
3
|
|
|
4
4
|
module YAML
|
|
5
|
-
# We trust our loaded YAMLs
|
|
6
|
-
# This patch is due to https://bugs.ruby-lang.org/issues/17866
|
|
7
|
-
# StackOverflow: https://stackoverflow.com/questions/71191685/visit-psych-nodes-alias-unknown-alias-default-psychbadalias/71192990#71192990
|
|
8
5
|
class << self
|
|
9
|
-
|
|
6
|
+
def trusted_load(content)
|
|
7
|
+
if YAML.respond_to? :unsafe_load
|
|
8
|
+
YAML.unsafe_load content
|
|
9
|
+
else
|
|
10
|
+
YAML.load content
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def trusted_load_file(path)
|
|
15
|
+
trusted_load File.read(path)
|
|
16
|
+
end
|
|
10
17
|
|
|
11
18
|
def load_erb_file(path)
|
|
12
|
-
YAML.
|
|
19
|
+
YAML.trusted_load ERB.new(File.read(path)).result
|
|
13
20
|
end
|
|
14
21
|
end
|
|
15
22
|
end
|
|
@@ -79,6 +79,21 @@ render_markdown:
|
|
|
79
79
|
|
|
80
80
|
m`$ bashly render templates/markdown docs`
|
|
81
81
|
|
|
82
|
+
render_markdown_github:
|
|
83
|
+
help: Copy the github markdown templates to your project, allowing you to customize the markdown documentation output.
|
|
84
|
+
skip_src_check: true
|
|
85
|
+
files:
|
|
86
|
+
- source: "render/markdown_github/README.md"
|
|
87
|
+
target: "templates/markdown_github/README.md"
|
|
88
|
+
- source: "render/markdown_github/markdown.gtx"
|
|
89
|
+
target: "templates/markdown_github/markdown.gtx"
|
|
90
|
+
- source: "render/markdown_github/render.rb"
|
|
91
|
+
target: "templates/markdown_github/render.rb"
|
|
92
|
+
post_install_message: |
|
|
93
|
+
Generate your markdown documentation by running:
|
|
94
|
+
|
|
95
|
+
m`$ bashly render templates/markdown_github docs`
|
|
96
|
+
|
|
82
97
|
render_mandoc:
|
|
83
98
|
help: Copy the mandoc templates to your project, allowing you to customize the man documentation output.
|
|
84
99
|
skip_src_check: true
|
|
@@ -120,6 +120,12 @@ show_examples_on_error: false
|
|
|
120
120
|
# all the private elements in the usage texts, as if they were public.
|
|
121
121
|
private_reveal_key: ~
|
|
122
122
|
|
|
123
|
+
# When enabling argfile for any command, this setting controls the name of the
|
|
124
|
+
# environment variable that can override or disable argfile loading at runtime.
|
|
125
|
+
# Set the variable to `0`, `off`, `no` or `false` to disable argfile loading,
|
|
126
|
+
# or to a different path to load another argfile instead.
|
|
127
|
+
argfile_var: ARGFILE
|
|
128
|
+
|
|
123
129
|
# Display various usage elements in color by providing the name of the color
|
|
124
130
|
# function. The value for each property is a name of a function that is
|
|
125
131
|
# available in your script, for example: `green` or `bold`.
|
|
@@ -13,7 +13,7 @@ module Bashly
|
|
|
13
13
|
private
|
|
14
14
|
|
|
15
15
|
def values!
|
|
16
|
-
defaults = YAML.
|
|
16
|
+
defaults = YAML.trusted_load_file asset('libraries/strings/strings.yml')
|
|
17
17
|
defaults.merge project_strings
|
|
18
18
|
end
|
|
19
19
|
|
|
@@ -23,7 +23,7 @@ module Bashly
|
|
|
23
23
|
|
|
24
24
|
def project_strings!
|
|
25
25
|
if File.exist? project_strings_path
|
|
26
|
-
YAML.
|
|
26
|
+
YAML.trusted_load_file project_strings_path
|
|
27
27
|
else
|
|
28
28
|
{}
|
|
29
29
|
end
|