mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
a3e20a4d38
"function --argument" is not a thing, it's "--argument-names". This only accidentally works because our getopt is awful and allows abbreviated long options. Similarly, one argparse test used "--d" instead of "-d" or "--def".
5 lines
283 B
Fish
5 lines
283 B
Fish
function __fish_append -d "Internal completion function for appending string to the commandline" --argument-names sep
|
|
set -e argv[1]
|
|
set -l str (commandline -tc | string replace -rf "(.*$sep)[^$sep]*" '$1' | string replace -r -- '--.*=' '')
|
|
printf "%s\n" "$str"$argv
|
|
end
|