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 11# # before hook
22# #
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 ).
55# #
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`
88# #
99# # You can safely delete this file if you do not need it.
1010echo " ==[ Before Hook Called ]=="
11- inspect_args
11+ inspect_args
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 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.
119# #
1210# # You can safely delete this file if you do not need it.
Original file line number Diff line number Diff line change 11.\" Automatically generated by Pandoc 3.2
22.\"
3- .TH "download" "1" "January 2026 " "Version 0.1.0" "Sample application"
3+ .TH "download" "1" "August 2025 " "Version 0.1.0" "Sample application"
44.SH NAME
55\f[B] download \f[ R ] \- Sample application
66.SH SYNOPSIS
Original file line number Diff line number Diff line change 11% download(1) Version 0.1.0 | Sample application
22% Lana Lang
3- % January 2026
3+ % August 2025
44
55NAME
66==================================================
Original file line number Diff line number Diff line change 11# # before hook
22# #
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 ).
55# #
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`
88# #
99# # You can safely delete this file if you do not need it.
1010echo " ==[ Before Hook Called ]=="
11- inspect_args
11+ inspect_args
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 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.
119# #
1210# # You can safely delete this file if you do not need it.
Original file line number Diff line number Diff line change 11= view_marker
22
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 11#! /usr/bin/env bash
22...
3- run " $@ "
3+ fi
Original file line number Diff line number Diff line change 1717
1818 it 'prints the generated cli script' do
1919 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 " )
2121 end
2222 end
2323end
24+
25+
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 [ -3 ] ) . to eq ' run "$@ "'
14+ expect ( lines [ -2 ] ) . to eq ' run "${command_line[@]} "'
1515 end
1616 end
1717
You can’t perform that action at this time.
0 commit comments