mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-22 05:37:36 +08: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".
6 lines
283 B
Fish
6 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
|