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.
43
43
- [ key-value-pairs] ( key-value-pairs#readme ) - parsing key=value arguments and flags
44
44
- [ command-examples-on-error] ( command-examples-on-error#readme ) - showing examples on error
45
45
- [ internal-run] ( internal-run#readme ) - calling other commands internally
46
+ - [ command-line-manipulation] ( command-line-manipulation#readme ) - read or modify the raw command line
46
47
47
48
## Customization
48
49
Original file line number Diff line number Diff line change 46
46
echo "==[ Initialize Called ]=="
47
47
48
48
# 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")
51
51
fi
52
52
53
53
````
Original file line number Diff line number Diff line change 1
1
echo " ==[ Initialize Called ]=="
2
2
3
3
# 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" )
6
6
fi
Original file line number Diff line number Diff line change @@ -52,16 +52,6 @@ commands:
52
52
# ## `$ ./cli download`
53
53
54
54
` ` ` ` 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
65
55
66
56
67
57
````
Original file line number Diff line number Diff line change 3
3
# # Any code here will be placed inside the `initialize()` function and called
4
4
# # before running anything else.
5
5
# #
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 ,
8
8
# # though this is usually only needed for advanced use cases.
9
9
# #
10
10
# # 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
102
102
AUTHORS
103
103
Lana Lang.
104
104
105
- Version 0.1.0 July 2025 download(1)
105
+ Version 0.1.0 August 2025 download(1)
106
106
107
107
108
108
````
Original file line number Diff line number Diff line change @@ -117,8 +117,8 @@ Examples:
117
117
118
118
Stack trace:
119
119
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`
122
122
123
123
124
124
````
Original file line number Diff line number Diff line change 3
3
# # Any code here will be placed inside the `initialize()` function and called
4
4
# # before running anything else.
5
5
# #
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 `
7
7
# # array. You can modify or override the input before it is processed further,
8
8
# # though this is usually only needed for advanced use cases.
9
9
# #
Original file line number Diff line number Diff line change 1
1
= view_marker
2
2
3
- > command_line =("$@")
3
+ > command_line_args =("$@")
4
4
> {{ 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 11
11
lines = subject . code . split "\n "
12
12
expect ( lines [ 0 ..13 ] . join ( "\n " ) ) . to match_approval ( 'script/wrapper/code' )
13
13
. 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 [@]}"'
15
15
end
16
16
end
17
17
You can’t perform that action at this time.
0 commit comments