File tree Expand file tree Collapse file tree 10 files changed +26
-31
lines changed Expand file tree Collapse file tree 10 files changed +26
-31
lines changed Original file line number Diff line number Diff line change 1
1
# # before hook
2
2
# #
3
- # # Any code here will be placed inside a `before_hook()` function and called
4
- # # before running any command (but after processing its arguments ).
3
+ # # Any code here will be placed inside the `before_hook()` function and called
4
+ # # before running any command (but after argument processing is complete ).
5
5
# #
6
- # # - The processed args are available to you here as `$ args` and `$ extra_args`
7
- # # - The raw input array is also available in read-only mode as `$ input`
6
+ # # - The processed args are available to you here as `args` and `extra_args`
7
+ # # - The raw input array is also available in read-only mode as `input`
8
8
# #
9
9
# # You can safely delete this file if you do not need it.
10
10
echo " ==[ Before Hook Called ]=="
11
- inspect_args
11
+ inspect_args
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 raw command line arguments are available to you here as "$@"
7
- # # - If you wish to override the raw arguments before they are processed,
8
- # # simply define an array named `input_override`:
9
- # #
10
- # # declare -g -a input_override=("modified" "args")
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,
8
+ # # though this is usually only needed for advanced use cases.
11
9
# #
12
10
# # You can safely delete this file if you do not need it.
Original file line number Diff line number Diff line change 1
1
.\" Automatically generated by Pandoc 3.2
2
2
.\"
3
- .TH "download" "1" "January 2026 " "Version 0.1.0" "Sample application"
3
+ .TH "download" "1" "August 2025 " "Version 0.1.0" "Sample application"
4
4
.SH NAME
5
5
\f[B] download \f[ R ] \- Sample application
6
6
.SH SYNOPSIS
Original file line number Diff line number Diff line change 1
1
% download(1) Version 0.1.0 | Sample application
2
2
% Lana Lang
3
- % January 2026
3
+ % August 2025
4
4
5
5
NAME
6
6
==================================================
Original file line number Diff line number Diff line change 1
1
# # before hook
2
2
# #
3
- # # Any code here will be placed inside a `before_hook()` function and called
4
- # # before running any command (but after processing its arguments ).
3
+ # # Any code here will be placed inside the `before_hook()` function and called
4
+ # # before running any command (but after argument processing is complete ).
5
5
# #
6
- # # - The processed args are available to you here as `$ args` and `$ extra_args`
7
- # # - The raw input array is also available in read-only mode as `$ input`
6
+ # # - The processed args are available to you here as `args` and `extra_args`
7
+ # # - The raw input array is also available in read-only mode as `input`
8
8
# #
9
9
# # You can safely delete this file if you do not need it.
10
10
echo " ==[ Before Hook Called ]=="
11
- inspect_args
11
+ inspect_args
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 raw command line arguments are available to you here as "$@"
7
- # # - If you wish to override the raw arguments before they are processed,
8
- # # simply define an array named `input_override`:
9
- # #
10
- # # declare -g -a input_override=("modified" "args")
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,
8
+ # # though this is usually only needed for advanced use cases.
11
9
# #
12
10
# # You can safely delete this file if you do not need it.
Original file line number Diff line number Diff line change 1
1
= view_marker
2
2
3
- > {{ Settings.function_name :initialize }} "$@"
4
- > if [[ -v input_override ]]; then
5
- > {{ Settings.function_name :run }} "${input_override[@]}"
6
- > else
7
- > {{ Settings.function_name :run }} "$@"
8
- > fi
3
+ > command_line=("$@")
4
+ > {{ Settings.function_name :initialize }}
5
+ > {{ Settings.function_name :run }} "${command_line[@]}"
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
...
3
- run " $@ "
3
+ fi
Original file line number Diff line number Diff line change 17
17
18
18
it 'prints the generated cli script' do
19
19
expect { subject . execute %w[ preview ] } . to output_approval ( 'cli/preview/no-args' )
20
- . except ( /env bash\n .*\n \s *run " \$ @" \n .* /m , "env bash\n ...\n run \" $@ \" " )
20
+ . except ( /env bash\n .*\n \s *fi \n /m , "env bash\n ...\n fi \b " )
21
21
end
22
22
end
23
23
end
24
+
25
+
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 [ -3 ] ) . to eq ' run "$@ "'
14
+ expect ( lines [ -2 ] ) . to eq ' run "${command_line[@]} "'
15
15
end
16
16
end
17
17
You can’t perform that action at this time.
0 commit comments