File tree Expand file tree Collapse file tree 10 files changed +14
-23
lines changed
command-line-manipulation Expand file tree Collapse file tree 10 files changed +14
-23
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ Each of these examples demonstrates one aspect or feature of bashly.
4343- [ key-value-pairs] ( key-value-pairs#readme ) - parsing key=value arguments and flags
4444- [ command-examples-on-error] ( command-examples-on-error#readme ) - showing examples on error
4545- [ internal-run] ( internal-run#readme ) - calling other commands internally
46+ - [ command-line-manipulation] ( command-line-manipulation#readme ) - read or modify the raw command line
4647
4748## Customization
4849
Original file line number Diff line number Diff line change 4646echo "==[ Initialize Called ]=="
4747
4848# Override the command line completely if the first argument is 'debug'
49- if [[ "${command_line [0]:-""}" = "debug" ]]; then
50- command_line =("modified" "args" "--force")
49+ if [[ "${command_line_args [0]:-""}" = "debug" ]]; then
50+ command_line_args =("modified" "args" "--force")
5151fi
5252
5353````
Original file line number Diff line number Diff line change 11echo " ==[ Initialize Called ]=="
22
33# Override the command line completely if the first argument is 'debug'
4- if [[ " ${command_line [0]:- " " } " = " debug" ]]; then
5- command_line =(" modified" " args" " --force" )
4+ if [[ " ${command_line_args [0]:- " " } " = " debug" ]]; then
5+ command_line_args =(" modified" " args" " --force" )
66fi
Original file line number Diff line number Diff line change @@ -52,16 +52,6 @@ commands:
5252# ## `$ ./cli download`
5353
5454` ` ` ` shell
55- # This file is located at 'src/download_command.sh'.
56- # It contains the implementation for the 'cli download' command.
57- # The code you write here will be wrapped by a function named 'cli_download_command()'.
58- # Feel free to edit this file; your changes will persist when regenerating.
59- args : none
60-
61- deps :
62- - ${deps[git]} = /usr/bin/git
63- - ${deps[http_client]} = /usr/bin/curl
64- - ${deps[ruby]} = /home/vagrant/.rbenv/versions/3.4.1/bin/ruby
6555
6656
6757````
Original file line number Diff line number Diff line change 33# # Any code here will be placed inside the `initialize()` function and called
44# # before running anything else.
55# #
6- # # The original command line arguments are available in the `command_line` array.
7- # # You can modify this array to adjust or override the input before the app runs ,
6+ # # The original command line arguments are available in the `command_line_args`
7+ # # array. You can modify or override the input before it is processed further ,
88# # though this is usually only needed for advanced use cases.
99# #
1010# # You can safely delete this file if you do not need it.
Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ ISSUE TRACKER
102102AUTHORS
103103 Lana Lang.
104104
105- Version 0.1.0 July 2025 download(1)
105+ Version 0.1.0 August 2025 download(1)
106106
107107
108108````
Original file line number Diff line number Diff line change @@ -117,8 +117,8 @@ Examples:
117117
118118Stack trace:
119119 from ./download:15 in ` root_command`
120- from ./download:260 in ` run`
121- from ./download:266 in ` main`
120+ from ./download:259 in ` run`
121+ from ./download:267 in ` main`
122122
123123
124124````
Original file line number Diff line number Diff line change 33# # Any code here will be placed inside the `initialize()` function and called
44# # before running anything else.
55# #
6- # # The original command line arguments are available in the `command_line `
6+ # # The original command line arguments are available in the `command_line_args `
77# # array. You can modify or override the input before it is processed further,
88# # though this is usually only needed for advanced use cases.
99# #
Original file line number Diff line number Diff line change 11= view_marker
22
3- > command_line =("$@")
3+ > command_line_args =("$@")
44> {{ Settings.function_name :initialize }}
5- > {{ Settings.function_name :run }} "${command_line [@]}"
5+ > {{ Settings.function_name :run }} "${command_line_args [@]}"
Original file line number Diff line number Diff line change 1111 lines = subject . code . split "\n "
1212 expect ( lines [ 0 ..13 ] . join ( "\n " ) ) . to match_approval ( 'script/wrapper/code' )
1313 . except ( /\d +\. \d +\. \d +(\. rc\d )?/ )
14- expect ( lines [ -2 ] ) . to eq ' run "${command_line [@]}"'
14+ expect ( lines [ -2 ] ) . to eq ' run "${command_line_args [@]}"'
1515 end
1616 end
1717
You can’t perform that action at this time.
0 commit comments