mirror of
https://github.com/morluto/rea.git
synced 2026-11-07 05:56:19 -10:00
fix(cli): preserve literal Bash completion candidates (#9153)
* test(process): align symlink fixture with filesystem checkpoints * test(frida): assert the CLI spawn Evidence contract * test(mcp): use an unsupported analysis-view parent * test(browser): separate source-location line bounds from parity * fix(cli): preserve literal Bash completion candidates
This commit is contained in:
1 parent
9cdcdf3dff
commit
fdd4aefd18
2 files changed
+7
-6
No files matched your search
@@ -5,16 +5,17 @@ export const bashCompletionScript = (name: string): string => {
|
||||
return `_incur_complete_${id}() {
|
||||
local IFS=$'\\013'
|
||||
local _COMPLETE_INDEX=\${COMP_CWORD}
|
||||
local _completions
|
||||
_completions=( $(
|
||||
local _completions _output
|
||||
if ! _output=$(
|
||||
export COMPLETE="bash"
|
||||
export _COMPLETE_INDEX="$_COMPLETE_INDEX"
|
||||
${command} -- "\${COMP_WORDS[@]}"
|
||||
) )
|
||||
if [[ $? != 0 ]]; then
|
||||
); then
|
||||
unset COMPREPLY
|
||||
return
|
||||
fi
|
||||
# Split the protocol records without expanding pathname patterns.
|
||||
read -r -d '' -a _completions < <(printf '%s\\0' "$_output")
|
||||
local _nospace=false
|
||||
local _nospace_marker=$'\\001'
|
||||
local _c
|
||||
|
||||
@@ -21,7 +21,7 @@ complete -p rea || exit
|
||||
rea() {
|
||||
[[ "$COMPLETE" == bash && "$_COMPLETE_INDEX" == 1 ]] || return 1
|
||||
[[ "$1" == -- && "$2" == rea && "$3" == ana ]] || return 1
|
||||
printf 'analyze\\013analyze-web-bundle\\013'
|
||||
printf 'analyze\\013analyze-web-bundle\\013*.json\\013'
|
||||
}
|
||||
COMP_WORDS=(rea ana)
|
||||
COMP_CWORD=1
|
||||
@@ -33,7 +33,7 @@ printf '%s\\n' "\${COMPREPLY[@]}"
|
||||
);
|
||||
expect(stderr).toBe("");
|
||||
expect(stdout).toContain("-F _incur_complete_rea rea");
|
||||
expect(stdout).toContain("\nanalyze\nanalyze-web-bundle\n");
|
||||
expect(stdout).toContain("\nanalyze\nanalyze-web-bundle\n*.json\n");
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
Reference in new issue
Block a user