File tree Expand file tree Collapse file tree 15 files changed +230
-10
lines changed
fixtures/workspaces/flag-args-with-dash Expand file tree Collapse file tree 15 files changed +230
-10
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,6 @@ FROM dannyben/alpine-ruby
33ENV PS1 "\n\n >> bashly \W \$ "
44WORKDIR /app
55
6- RUN gem install bashly --version 0.4.0
6+ RUN gem install bashly --version 0.4.1rc1
77
88ENTRYPOINT ["bashly" ]
Original file line number Diff line number Diff line change @@ -354,7 +354,7 @@ cli_upload_parse_requirements() {
354354 case " $key " in
355355 # :flag.case
356356 --user | -u )
357- if [[ $2 && $2 != - * ]]; then
357+ if [[ $2 ]]; then
358358 args[--user]=" $2 "
359359 shift
360360 shift
@@ -366,7 +366,7 @@ cli_upload_parse_requirements() {
366366
367367 # :flag.case
368368 --password | -p )
369- if [[ $2 && $2 != - * ]]; then
369+ if [[ $2 ]]; then
370370 args[--password]=" $2 "
371371 shift
372372 shift
Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ parse_requirements() {
109109 case " $key " in
110110 # :flag.case
111111 --out | -o )
112- if [[ $2 && $2 != - * ]]; then
112+ if [[ $2 ]]; then
113113 args[--out]=" $2 "
114114 shift
115115 shift
Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ parse_requirements() {
107107 case " $key " in
108108 # :flag.case
109109 --format | -f )
110- if [[ $2 && $2 != - * ]]; then
110+ if [[ $2 ]]; then
111111 args[--format]=" $2 "
112112 shift
113113 shift
Original file line number Diff line number Diff line change @@ -276,7 +276,7 @@ git_commit_parse_requirements() {
276276 case " $key " in
277277 # :flag.case
278278 --message | -m )
279- if [[ $2 && $2 != - * ]]; then
279+ if [[ $2 ]]; then
280280 args[--message]=" $2 "
281281 shift
282282 shift
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ parse_requirements() {
101101
102102 # :flag.case
103103 --host | -h )
104- if [[ $2 && $2 != - * ]]; then
104+ if [[ $2 ]]; then
105105 args[--host]=" $2 "
106106 shift
107107 shift
Original file line number Diff line number Diff line change @@ -170,7 +170,7 @@ parse_requirements() {
170170 case " $key " in
171171 # :flag.case
172172 --prefix | -p )
173- if [[ $2 && $2 != - * ]]; then
173+ if [[ $2 ]]; then
174174 args[--prefix]=" $2 "
175175 shift
176176 shift
Original file line number Diff line number Diff line change 11module Bashly
2- VERSION = "0.4.0 "
2+ VERSION = "0.4.1rc1 "
33end
Original file line number Diff line number Diff line change 11# :flag.case
22<%= aliases.join " | " %> )
33 <%- if arg -%>
4- if [[ $2 && $2 != -* ]]; then
4+ if [[ $2 ]]; then
55 args[<%= name %> ]="$2"
66 shift
77 shift
Original file line number Diff line number Diff line change 1+ + bashly generate
2+ creating user files in src
3+ created src/initialize.sh
4+ created src/root_command.sh
5+ created ./argflag
6+ run ./argflag --help to test your bash script
7+ + ./argflag -f -o
8+ --options requires an argument: --options, -o LIST
9+ + ./argflag -o -f
10+ # this file is located in 'src/root_command.sh'
11+ # you can edit it freely and regenerate (it will not be overwritten)
12+ args:
13+ - ${args[--options]} = -f
14+ + ./argflag -o '--verbose --anything' -f
15+ # this file is located in 'src/root_command.sh'
16+ # you can edit it freely and regenerate (it will not be overwritten)
17+ args:
18+ - ${args[--force]} = 1
19+ - ${args[--options]} = --verbose --anything
You can’t perform that action at this time.
0 commit comments