bashly 0.6.5 → 0.6.6

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: 5b02a163470ebeb4c59a97f475b40b760477d36df16189addb48049b11b8842a
4
- data.tar.gz: 625b89b6a09fc59f6a4a19fceaf05f645dec0c45cc33cda3a445fe123f43dbb6
3
+ metadata.gz: e61f83f8d8f8b4992a5f7d66731de37d640dd1da71c8bc243558ba173f56a76c
4
+ data.tar.gz: c85eb4ea1c11c97c494b969075553f3a341bc29ac44ba94a4763d5efe1b03af0
5
5
  SHA512:
6
- metadata.gz: 6e2bd2c31ab003d916efa2590e8571b7cbf3b6e88c3cee9122f5bc24d57b9624e52d7589bffdf2604132d55b040ff735effc02d49e4b6a8479817122ce98f612
7
- data.tar.gz: 8fe5d95ea5061d88fb0b0da02266b69ed6530379d3e030d5f71fd1edf8bd97c3690ea82a89c36bb55a27790363ccd52be4de9e4aa1ba5ae07cb0c8ce87b8fd89
6
+ metadata.gz: 1685fa4d73c0bc652e3043e8686e39b8ce7571f7baa41e5c84fa5dcce01a49331fd65af7a817bdbd0b985200c9a0502565bfece80414d58b3eed2b1729be101d
7
+ data.tar.gz: d20da15898e3792bb6efeb7257d0b4a21dc6c0adc5dca00b72411dd37acfd61a926427ec70264058fd276c509c24d7a5d7b7235f66b74b075d86ff1266b2163f
@@ -209,7 +209,7 @@ module Bashly
209
209
  # This is meant to provide the user with the ability to add custom
210
210
  # functions
211
211
  def user_lib
212
- @user_lib ||= Dir["#{Settings.source_dir}/lib/**/*.sh"]
212
+ @user_lib ||= Dir["#{Settings.source_dir}/lib/**/*.sh"].sort
213
213
  end
214
214
 
215
215
  # Raise an exception if there are some serious issues with the command
@@ -238,4 +238,4 @@ module Bashly
238
238
 
239
239
  end
240
240
  end
241
- end
241
+ end
@@ -1,3 +1,3 @@
1
1
  module Bashly
2
- VERSION = "0.6.5"
2
+ VERSION = "0.6.6"
3
3
  end
@@ -1,6 +1,7 @@
1
1
  <%= render :root_command if commands.empty? %>
2
2
  <%= render :version_command %>
3
3
  <%= render :usage %>
4
+ <%= render :normalize_input %>
4
5
  <%= render :inspect_args %>
5
6
  <%= render :user_lib if user_lib.any? %>
6
7
  <%= render :command_functions %>
@@ -0,0 +1,24 @@
1
+ # :command.normalize_input
2
+ normalize_input() {
3
+ local arg flags
4
+
5
+ while [[ $# -gt 0 ]]; do
6
+ arg="$1"
7
+ if [[ $arg =~ ^(--[a-zA-Z0-9_\-]+)=(.+)$ ]]; then
8
+ input+=("${BASH_REMATCH[1]}")
9
+ input+=("${BASH_REMATCH[2]}")
10
+ elif [[ $arg =~ ^(-[a-zA-Z0-9])=(.+)$ ]]; then
11
+ input+=("${BASH_REMATCH[1]}")
12
+ input+=("${BASH_REMATCH[2]}")
13
+ elif [[ $arg =~ ^-([a-zA-Z0-9][a-zA-Z0-9]+)$ ]]; then
14
+ flags="${BASH_REMATCH[1]}"
15
+ for (( i=0 ; i < ${#flags} ; i++ )); do
16
+ input+=("-${flags:i:1}")
17
+ done
18
+ else
19
+ input+=("$arg")
20
+ fi
21
+
22
+ shift
23
+ done
24
+ }
@@ -2,7 +2,9 @@
2
2
  run() {
3
3
  declare -A args
4
4
  declare -a other_args
5
- parse_requirements "$@"
5
+ declare -a input
6
+ normalize_input "$@"
7
+ parse_requirements "${input[@]}"
6
8
 
7
9
  <%- condition = "if" -%>
8
10
  <%- deep_commands.each do |command| -%>
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.6.5
4
+ version: 0.6.6
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-09-03 00:00:00.000000000 Z
11
+ date: 2021-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colsole
@@ -122,6 +122,7 @@ files:
122
122
  - lib/bashly/views/command/initialize.erb
123
123
  - lib/bashly/views/command/inspect_args.erb
124
124
  - lib/bashly/views/command/master_script.erb
125
+ - lib/bashly/views/command/normalize_input.erb
125
126
  - lib/bashly/views/command/parse_requirements.erb
126
127
  - lib/bashly/views/command/parse_requirements_case.erb
127
128
  - lib/bashly/views/command/parse_requirements_while.erb