Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/catch-all/src/root_command.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
echo "# This file is located at 'src/root_command.sh'."
echo "# It contains the implementation for the 'download' command."
echo "# The code you write here will be wrapped by a function named 'download_command()'."
echo "# The code you write here will be wrapped by a function named 'root_command()'."
echo "# Feel free to edit this file; your changes will persist when regenerating."
inspect_args
2 changes: 1 addition & 1 deletion examples/custom-strings/src/root_command.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
echo "# This file is located at 'src/root_command.sh'."
echo "# It contains the implementation for the 'download' command."
echo "# The code you write here will be wrapped by a function named 'download_command()'."
echo "# The code you write here will be wrapped by a function named 'root_command()'."
echo "# Feel free to edit this file; your changes will persist when regenerating."
inspect_args
2 changes: 1 addition & 1 deletion examples/default-values/src/root_command.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
echo "# This file is located at 'src/root_command.sh'."
echo "# It contains the implementation for the 'convert' command."
echo "# The code you write here will be wrapped by a function named 'convert_command()'."
echo "# The code you write here will be wrapped by a function named 'root_command()'."
echo "# Feel free to edit this file; your changes will persist when regenerating."
inspect_args
2 changes: 1 addition & 1 deletion examples/footer/src/root_command.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
echo "# This file is located at 'src/root_command.sh'."
echo "# It contains the implementation for the 'download' command."
echo "# The code you write here will be wrapped by a function named 'download_command()'."
echo "# The code you write here will be wrapped by a function named 'root_command()'."
echo "# Feel free to edit this file; your changes will persist when regenerating."
inspect_args
2 changes: 1 addition & 1 deletion examples/help-header-override/src/root_command.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
echo "# This file is located at 'src/root_command.sh'."
echo "# It contains the implementation for the 'download' command."
echo "# The code you write here will be wrapped by a function named 'download_command()'."
echo "# The code you write here will be wrapped by a function named 'root_command()'."
echo "# Feel free to edit this file; your changes will persist when regenerating."
inspect_args
2 changes: 1 addition & 1 deletion examples/minimal/src/root_command.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
echo "# This file is located at 'src/root_command.sh'."
echo "# It contains the implementation for the 'download' command."
echo "# The code you write here will be wrapped by a function named 'download_command()'."
echo "# The code you write here will be wrapped by a function named 'root_command()'."
echo "# Feel free to edit this file; your changes will persist when regenerating."
inspect_args
2 changes: 1 addition & 1 deletion examples/minus-v/src/root_command.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
echo "# This file is located at 'src/root_command.sh'."
echo "# It contains the implementation for the 'cli' command."
echo "# The code you write here will be wrapped by a function named 'cli_command()'."
echo "# The code you write here will be wrapped by a function named 'root_command()'."
echo "# Feel free to edit this file; your changes will persist when regenerating."
inspect_args
2 changes: 1 addition & 1 deletion examples/whitelist/src/root_command.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
echo "# This file is located at 'src/root_command.sh'."
echo "# It contains the implementation for the 'login' command."
echo "# The code you write here will be wrapped by a function named 'login_command()'."
echo "# The code you write here will be wrapped by a function named 'root_command()'."
echo "# Feel free to edit this file; your changes will persist when regenerating."
inspect_args
2 changes: 1 addition & 1 deletion lib/bashly/views/command/default_script.gtx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
> echo "# This file is located at '{{ "#{Settings.source_dir}/#{filename}" }}'."
> echo "# It contains the implementation for the '{{ full_name }}' command."
> echo "# The code you write here will be wrapped by a function named '{{ function_name }}_command()'."
> echo "# The code you write here will be wrapped by a function named '{{ root_command? ? 'root' : function_name }}_command()'."
> echo "# Feel free to edit this file; your changes will persist when regenerating."
if Settings.enabled? :inspect_args
> inspect_args
Expand Down
6 changes: 3 additions & 3 deletions spec/approvals/examples/catch-all
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ Arguments:
+ ./download something
# This file is located at 'src/root_command.sh'.
# It contains the implementation for the 'download' command.
# The code you write here will be wrapped by a function named 'download_command()'.
# The code you write here will be wrapped by a function named 'root_command()'.
# Feel free to edit this file; your changes will persist when regenerating.
args:
- ${args[message]} = something
+ ./download something with --additional args
# This file is located at 'src/root_command.sh'.
# It contains the implementation for the 'download' command.
# The code you write here will be wrapped by a function named 'download_command()'.
# The code you write here will be wrapped by a function named 'root_command()'.
# Feel free to edit this file; your changes will persist when regenerating.
args:
- ${args[message]} = something
Expand All @@ -51,7 +51,7 @@ other_args:
+ ./download something --debug -- also pass --debug to catch_all
# This file is located at 'src/root_command.sh'.
# It contains the implementation for the 'download' command.
# The code you write here will be wrapped by a function named 'download_command()'.
# The code you write here will be wrapped by a function named 'root_command()'.
# Feel free to edit this file; your changes will persist when regenerating.
args:
- ${args[--debug]} = 1
Expand Down
8 changes: 4 additions & 4 deletions spec/approvals/examples/default-values
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ run ./convert --help to test your bash script
+ ./convert
# This file is located at 'src/root_command.sh'.
# It contains the implementation for the 'convert' command.
# The code you write here will be wrapped by a function named 'convert_command()'.
# The code you write here will be wrapped by a function named 'root_command()'.
# Feel free to edit this file; your changes will persist when regenerating.
args:
- ${args[--format]} = png
Expand Down Expand Up @@ -43,23 +43,23 @@ Examples:
+ ./convert '*.bmp'
# This file is located at 'src/root_command.sh'.
# It contains the implementation for the 'convert' command.
# The code you write here will be wrapped by a function named 'convert_command()'.
# The code you write here will be wrapped by a function named 'root_command()'.
# Feel free to edit this file; your changes will persist when regenerating.
args:
- ${args[--format]} = png
- ${args[source]} = *.bmp
+ ./convert -f pdf
# This file is located at 'src/root_command.sh'.
# It contains the implementation for the 'convert' command.
# The code you write here will be wrapped by a function named 'convert_command()'.
# The code you write here will be wrapped by a function named 'root_command()'.
# Feel free to edit this file; your changes will persist when regenerating.
args:
- ${args[--format]} = pdf
- ${args[source]} = *.jpg
+ ./convert '*.pdf' --format gif
# This file is located at 'src/root_command.sh'.
# It contains the implementation for the 'convert' command.
# The code you write here will be wrapped by a function named 'convert_command()'.
# The code you write here will be wrapped by a function named 'root_command()'.
# Feel free to edit this file; your changes will persist when regenerating.
args:
- ${args[--format]} = gif
Expand Down
2 changes: 1 addition & 1 deletion spec/approvals/examples/footer
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ run ./download --help to test your bash script
+ ./download
# This file is located at 'src/root_command.sh'.
# It contains the implementation for the 'download' command.
# The code you write here will be wrapped by a function named 'download_command()'.
# The code you write here will be wrapped by a function named 'root_command()'.
# Feel free to edit this file; your changes will persist when regenerating.
args: none
+ ./download -h
Expand Down
2 changes: 1 addition & 1 deletion spec/approvals/examples/help-header-override
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ run ./download --help to test your bash script
+ ./download
# This file is located at 'src/root_command.sh'.
# It contains the implementation for the 'download' command.
# The code you write here will be wrapped by a function named 'download_command()'.
# The code you write here will be wrapped by a function named 'root_command()'.
# Feel free to edit this file; your changes will persist when regenerating.
args: none
+ ./download --help
Expand Down
2 changes: 1 addition & 1 deletion spec/approvals/examples/minimal
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Examples:
+ ./download somesource -f
# This file is located at 'src/root_command.sh'.
# It contains the implementation for the 'download' command.
# The code you write here will be wrapped by a function named 'download_command()'.
# The code you write here will be wrapped by a function named 'root_command()'.
# Feel free to edit this file; your changes will persist when regenerating.
args:
- ${args[--force]} = 1
Expand Down
6 changes: 3 additions & 3 deletions spec/approvals/examples/minus-v
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ run ./cli --help to test your bash script
+ ./cli
# This file is located at 'src/root_command.sh'.
# It contains the implementation for the 'cli' command.
# The code you write here will be wrapped by a function named 'cli_command()'.
# The code you write here will be wrapped by a function named 'root_command()'.
# Feel free to edit this file; your changes will persist when regenerating.
args: none
+ ./cli --help
Expand Down Expand Up @@ -37,14 +37,14 @@ Options:
+ ./cli -v
# This file is located at 'src/root_command.sh'.
# It contains the implementation for the 'cli' command.
# The code you write here will be wrapped by a function named 'cli_command()'.
# The code you write here will be wrapped by a function named 'root_command()'.
# Feel free to edit this file; your changes will persist when regenerating.
args:
- ${args[--verbose]} = 1
+ ./cli -h localhost -v
# This file is located at 'src/root_command.sh'.
# It contains the implementation for the 'cli' command.
# The code you write here will be wrapped by a function named 'cli_command()'.
# The code you write here will be wrapped by a function named 'root_command()'.
# Feel free to edit this file; your changes will persist when regenerating.
args:
- ${args[--host]} = localhost
Expand Down
4 changes: 2 additions & 2 deletions spec/approvals/examples/whitelist
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ region must be one of: eu, us
+ ./login eu --user admin
# This file is located at 'src/root_command.sh'.
# It contains the implementation for the 'login' command.
# The code you write here will be wrapped by a function named 'login_command()'.
# The code you write here will be wrapped by a function named 'root_command()'.
# Feel free to edit this file; your changes will persist when regenerating.
args:
- ${args[environment]} = development
Expand All @@ -61,7 +61,7 @@ args:
+ ./login eu production --user admin --protocol ssh
# This file is located at 'src/root_command.sh'.
# It contains the implementation for the 'login' command.
# The code you write here will be wrapped by a function named 'login_command()'.
# The code you write here will be wrapped by a function named 'root_command()'.
# Feel free to edit this file; your changes will persist when regenerating.
args:
- ${args[environment]} = production
Expand Down
2 changes: 1 addition & 1 deletion spec/approvals/fixtures/catch-all-no-args
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ run ./download --help to test your bash script
+ ./download
# This file is located at 'src/root_command.sh'.
# It contains the implementation for the 'download' command.
# The code you write here will be wrapped by a function named 'download_command()'.
# The code you write here will be wrapped by a function named 'root_command()'.
# Feel free to edit this file; your changes will persist when regenerating.
args: none
+ ./download --help
Expand Down
2 changes: 1 addition & 1 deletion spec/approvals/fixtures/default-validations
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ must be an existing file
+ ./cli README.md --template cli
# This file is located at 'src/root_command.sh'.
# It contains the implementation for the 'cli' command.
# The code you write here will be wrapped by a function named 'cli_command()'.
# The code you write here will be wrapped by a function named 'root_command()'.
# Feel free to edit this file; your changes will persist when regenerating.
args:
- ${args[file]} = README.md
Expand Down
8 changes: 4 additions & 4 deletions spec/approvals/fixtures/flag-args-with-dash
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ run ./argflag --help to test your bash script
+ ./argflag -o -f
# This file is located at 'src/root_command.sh'.
# It contains the implementation for the 'argflag' command.
# The code you write here will be wrapped by a function named 'argflag_command()'.
# The code you write here will be wrapped by a function named 'root_command()'.
# Feel free to edit this file; your changes will persist when regenerating.
args:
- ${args[--options]} = -f
+ ./argflag -o '--verbose --anything' -f
# This file is located at 'src/root_command.sh'.
# It contains the implementation for the 'argflag' command.
# The code you write here will be wrapped by a function named 'argflag_command()'.
# The code you write here will be wrapped by a function named 'root_command()'.
# Feel free to edit this file; your changes will persist when regenerating.
args:
- ${args[--force]} = 1
Expand All @@ -29,14 +29,14 @@ run ./argflag --help to test your bash script
+ ./argflag -o -force
# This file is located at 'src/root_command.sh'.
# It contains the implementation for the 'argflag' command.
# The code you write here will be wrapped by a function named 'argflag_command()'.
# The code you write here will be wrapped by a function named 'root_command()'.
# Feel free to edit this file; your changes will persist when regenerating.
args:
- ${args[--options]} = -force
+ ./argflag -o '-f -o'
# This file is located at 'src/root_command.sh'.
# It contains the implementation for the 'argflag' command.
# The code you write here will be wrapped by a function named 'argflag_command()'.
# The code you write here will be wrapped by a function named 'root_command()'.
# Feel free to edit this file; your changes will persist when regenerating.
args:
- ${args[--options]} = -f -o
8 changes: 4 additions & 4 deletions spec/approvals/fixtures/flag-notation
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ run ./flags --help to test your bash script
+ ./flags -abC
# This file is located at 'src/root_command.sh'.
# It contains the implementation for the 'flags' command.
# The code you write here will be wrapped by a function named 'flags_command()'.
# The code you write here will be wrapped by a function named 'root_command()'.
# Feel free to edit this file; your changes will persist when regenerating.
args:
- ${args[--alfa]} = 1
Expand All @@ -15,21 +15,21 @@ args:
+ ./flags -d=2
# This file is located at 'src/root_command.sh'.
# It contains the implementation for the 'flags' command.
# The code you write here will be wrapped by a function named 'flags_command()'.
# The code you write here will be wrapped by a function named 'root_command()'.
# Feel free to edit this file; your changes will persist when regenerating.
args:
- ${args[--delta]} = 2
+ ./flags --echo=2
# This file is located at 'src/root_command.sh'.
# It contains the implementation for the 'flags' command.
# The code you write here will be wrapped by a function named 'flags_command()'.
# The code you write here will be wrapped by a function named 'root_command()'.
# Feel free to edit this file; your changes will persist when regenerating.
args:
- ${args[--echo]} = 2
+ ./flags '-E=- hello world'
# This file is located at 'src/root_command.sh'.
# It contains the implementation for the 'flags' command.
# The code you write here will be wrapped by a function named 'flags_command()'.
# The code you write here will be wrapped by a function named 'root_command()'.
# Feel free to edit this file; your changes will persist when regenerating.
args:
- ${args[--echo]} = - hello world
Expand Down
4 changes: 2 additions & 2 deletions spec/approvals/fixtures/flag-private
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ run ./cli --help to test your bash script
+ ./cli
# This file is located at 'src/root_command.sh'.
# It contains the implementation for the 'cli' command.
# The code you write here will be wrapped by a function named 'cli_command()'.
# The code you write here will be wrapped by a function named 'root_command()'.
# Feel free to edit this file; your changes will persist when regenerating.
args:
- ${args[--log]} = 3
Expand All @@ -31,7 +31,7 @@ Options:
+ ./cli --log 5
# This file is located at 'src/root_command.sh'.
# It contains the implementation for the 'cli' command.
# The code you write here will be wrapped by a function named 'cli_command()'.
# The code you write here will be wrapped by a function named 'root_command()'.
# Feel free to edit this file; your changes will persist when regenerating.
args:
- ${args[--log]} = 5
6 changes: 3 additions & 3 deletions spec/approvals/fixtures/repeatable-arg-validations
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ run ./cli --help to test your bash script
+ ./cli
# This file is located at 'src/root_command.sh'.
# It contains the implementation for the 'cli' command.
# The code you write here will be wrapped by a function named 'cli_command()'.
# The code you write here will be wrapped by a function named 'root_command()'.
# Feel free to edit this file; your changes will persist when regenerating.
args: none
+ ./cli 1
# This file is located at 'src/root_command.sh'.
# It contains the implementation for the 'cli' command.
# The code you write here will be wrapped by a function named 'cli_command()'.
# The code you write here will be wrapped by a function named 'root_command()'.
# Feel free to edit this file; your changes will persist when regenerating.
args:
- ${args[number]} = 1
Expand All @@ -25,7 +25,7 @@ must be an integer
+ ./cli 1 2
# This file is located at 'src/root_command.sh'.
# It contains the implementation for the 'cli' command.
# The code you write here will be wrapped by a function named 'cli_command()'.
# The code you write here will be wrapped by a function named 'root_command()'.
# Feel free to edit this file; your changes will persist when regenerating.
args:
- ${args[number]} = 1 2
Expand Down
6 changes: 3 additions & 3 deletions spec/approvals/fixtures/repeatable-flag-validations
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ run ./cli --help to test your bash script
+ ./cli
# This file is located at 'src/root_command.sh'.
# It contains the implementation for the 'cli' command.
# The code you write here will be wrapped by a function named 'cli_command()'.
# The code you write here will be wrapped by a function named 'root_command()'.
# Feel free to edit this file; your changes will persist when regenerating.
args: none
+ ./cli --number 1
# This file is located at 'src/root_command.sh'.
# It contains the implementation for the 'cli' command.
# The code you write here will be wrapped by a function named 'cli_command()'.
# The code you write here will be wrapped by a function named 'root_command()'.
# Feel free to edit this file; your changes will persist when regenerating.
args:
- ${args[--number]} = 1
Expand All @@ -25,7 +25,7 @@ must be an integer
+ ./cli --number 1 --number 2
# This file is located at 'src/root_command.sh'.
# It contains the implementation for the 'cli' command.
# The code you write here will be wrapped by a function named 'cli_command()'.
# The code you write here will be wrapped by a function named 'root_command()'.
# Feel free to edit this file; your changes will persist when regenerating.
args:
- ${args[--number]} = 1 2
Expand Down
6 changes: 3 additions & 3 deletions spec/approvals/fixtures/repeatable-whitelist
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ run ./download --help to test your bash script
+ ./download
# This file is located at 'src/root_command.sh'.
# It contains the implementation for the 'download' command.
# The code you write here will be wrapped by a function named 'download_command()'.
# The code you write here will be wrapped by a function named 'root_command()'.
# Feel free to edit this file; your changes will persist when regenerating.
args:
- ${args[--protocol]} = ftp
+ ./download -p ssh
# This file is located at 'src/root_command.sh'.
# It contains the implementation for the 'download' command.
# The code you write here will be wrapped by a function named 'download_command()'.
# The code you write here will be wrapped by a function named 'root_command()'.
# Feel free to edit this file; your changes will persist when regenerating.
args:
- ${args[--protocol]} = ssh
+ ./download -p ssh -p ftp
# This file is located at 'src/root_command.sh'.
# It contains the implementation for the 'download' command.
# The code you write here will be wrapped by a function named 'download_command()'.
# The code you write here will be wrapped by a function named 'root_command()'.
# Feel free to edit this file; your changes will persist when regenerating.
args:
- ${args[--protocol]} = ssh ftp
Expand Down
Loading