Skip to content

Commit 4048afc

Browse files
committed
rename command_line to command_line_args
1 parent 1abeb0a commit 4048afc

File tree

10 files changed

+14
-23
lines changed

10 files changed

+14
-23
lines changed

examples/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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

examples/command-line-manipulation/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ flags:
4646
echo "==[ 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")
5151
fi
5252

5353
````
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
echo "==[ 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")
66
fi

examples/dependencies-alt/README.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff 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
````

examples/hooks/src/initialize.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
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.

examples/render-mandoc/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ ISSUE TRACKER
102102
AUTHORS
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
````

examples/stacktrace/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ Examples:
117117

118118
Stack 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
````

lib/bashly/libraries/hooks/initialize.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
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
##

lib/bashly/views/command/start.gtx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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[@]}"

spec/bashly/script/wrapper_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
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

0 commit comments

Comments
 (0)