bashly 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 665f22f00a1ebc72e1d6e549cfea6030410a386a9375f39734a00e4091290e89
4
- data.tar.gz: 7e2a7b0afb183f1103d7a789fa6955e7520b63505130e764b91b14a3d3e15235
3
+ metadata.gz: 51726b1606a72cbed1bd541c1ec4043e1d3ee8fd84dcea162746cb953e6684f9
4
+ data.tar.gz: 965346a4e52205af43220f893b9c30978df49f376f1067ce4a25d8a4dda3c0b8
5
5
  SHA512:
6
- metadata.gz: 77d14c4d2ce85b462aea89a4cce5aadef3bf70ca6373bf782b58bedcf17fcd52d2fbe2bfd26569d9c0a03fecea2a1eec8c630eec51003438bdf8fe099b28bf3e
7
- data.tar.gz: c6b803f2390630053483ca5507df869c95f0fa50752d3f3cf9595807a5779b01724c99460ee8bf0c5a258959769100199a5876bafe62430189e925d697abd979
6
+ metadata.gz: bb165ce7cd9ed5a399d1792993d15e3939879e4462d23b89cb3ebad8e8964d75ab629c2ab5286b293a456a78d9daf567b2ac0235c00fc568da20cd4c201d2137
7
+ data.tar.gz: b87760cde516cb1964a90ce6017ea922198d67530c741e95c1c75e6568d9bb57653b3ed79b5613307ef188827ada05f4f4c97ba4f7e576e07d15962a126fddbb
@@ -3,7 +3,7 @@ module Bashly
3
3
  class EnvironmentVariable < Base
4
4
  def usage_string(extended: false)
5
5
  result = [name.upcase]
6
- result << "(required)" if required and extended
6
+ result << strings[:required] if required and extended
7
7
  result.join " "
8
8
  end
9
9
  end
@@ -14,7 +14,7 @@ module Bashly
14
14
  def usage_string(extended: false)
15
15
  result = [aliases.join(", ")]
16
16
  result << arg.upcase if arg
17
- result << "(required)" if required and extended
17
+ result << strings[:required] if required and extended
18
18
  result.join " "
19
19
  end
20
20
  end
@@ -1,3 +1,6 @@
1
+ # When overriding from the user folder, feel free to delete everything
2
+ # you do not plan on overriding to keep the default string.
3
+
1
4
  # Usage captions
2
5
  usage: "Usage:"
3
6
  options: "Options:"
@@ -6,6 +9,13 @@ commands: "Commands:"
6
9
  examples: "Examples:"
7
10
  environment_variables: "Environment Variables:"
8
11
 
12
+ # Usage helpers
13
+ command_shortcut: "Shortcut: %{short}"
14
+ default_command_summary: "%{summary} (default)"
15
+ required: "(required)"
16
+ help_flag: "--help | -h"
17
+ version_flag: "--version"
18
+
9
19
  # Fixed flags help text
10
20
  help_flag_text: Show this help
11
21
  version_flag_text: Show version number
@@ -1,3 +1,3 @@
1
1
  module Bashly
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
@@ -14,15 +14,21 @@
14
14
  printf "<%= caption_string %>\n"
15
15
  echo
16
16
  fi
17
+
18
+ <%- if short -%>
19
+ printf "<%= strings[:command_shortcut] % { short: short } %>\n"
20
+ echo
21
+ <%- end -%>
22
+
17
23
  printf "<%= strings[:usage] %>\n"
18
24
  printf " <%= usage_string %>\n"
19
25
  <%- if commands.any? -%>
20
26
  printf " <%= full_name %> [command] --help | -h\n"
21
27
  <%- else -%>
22
- printf " <%= full_name %> --help | -h\n"
28
+ printf " <%= full_name %> <%= strings[:help_flag] %>\n"
23
29
  <%- end -%>
24
30
  <%- if root_command? -%>
25
- printf " <%= full_name %> --version\n"
31
+ printf " <%= full_name %> <%= strings[:version_flag] %>\n"
26
32
  <%- end -%>
27
33
  echo
28
34
  <%= render(:usage_commands).indent 2 if commands.any? %>
@@ -3,7 +3,7 @@ printf "<%= strings[:commands] %>\n"
3
3
  <%- maxlen = command_names.map(&:size).max -%>
4
4
  <%- commands.each do |command| -%>
5
5
  <%- summary = command.summary -%>
6
- <%- summary = "#{summary} (default)" if command.default -%>
6
+ <%- summary = strings[:default_command_summary] % { summary: summary } if command.default -%>
7
7
  echo " <%= command.name.ljust maxlen %> <%= summary %>"
8
8
  <%- end -%>
9
9
  echo
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.3.2
4
+ version: 0.3.3
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: 2019-12-10 00:00:00.000000000 Z
11
+ date: 2019-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colsole