Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions autocomplete/fish_autocomplete
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This is a shell completion script auto-generated by https://github.com/urfave/cli for fish.

function __%[1]_perform_completion
function __%[1]s_perform_completion
# Extract all args except the last one
set -l args (commandline -opc)
Comment on lines +3 to 5
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not committed, not adding much

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TimSoethout Can you add or update an existing test case for this ?

Copy link
Contributor Author

@TimSoethout TimSoethout Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a testcase, but it didn't make much sense. It was more of a regression test which specifically pattern matched on the specific wrong/correct output syntax of the earlier bug/error.

There was no test in place before, so left it as is.

WDYT would make a valuable test case?
Ideally actually having fish source the output without errors, but not sure if we want to go that far?

# Extract the last arg (partial input)
Expand All @@ -18,18 +18,18 @@ function __%[1]_perform_completion
end

for line in $results
if not string match -q -- "%[1]*" $line
if not string match -q -- "%[1]s*" $line
set -l parts (string split -m 1 ":" -- "$line")
if test (count $parts) -eq 2
printf "%s\t%s\n" "$parts[1]" "$parts[2]"
printf "%%s\t%%s\n" "$parts[1]" "$parts[2]"
else
printf "%s\n" "$line"
printf "%%s\n" "$line"
end
end
end
end

# Clear existing completions for %[1]
complete -c %[1] -e
# Clear existing completions for %[1]s
complete -c %[1]s -e
# Register completion function
complete -c %[1] -f -a '(__%[1]_perform_completion)'
complete -c %[1]s -f -a '(__%[1]s_perform_completion)'
Loading