fish: allow multiple commands for command option in abbreviations (#6851)

This commit is contained in:
Karun Sandhu 2025-04-20 07:23:07 +02:00 committed by GitHub
parent 20705949f1
commit b8d186abf8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 1 deletions

View file

@ -185,7 +185,7 @@ let
};
command = mkOption {
type = with types; nullOr str;
type = with types; nullOr (either str (listOf str));
default = null;
description = ''
Specifies the command(s) for which the abbreviation should expand. If

View file

@ -39,6 +39,13 @@
command = "git";
expansion = "checkout";
};
s = {
command = [
"git"
"hg"
];
expansion = "status";
};
dotdot = {
regex = "^\\.\\.+$";
function = "multicd";
@ -70,6 +77,8 @@
'"
assertFileContains home-files/.config/fish/config.fish \
"abbr --add --command git -- co checkout"
assertFileContains home-files/.config/fish/config.fish \
"abbr --add --command git --command hg -- s status"
assertFileContains home-files/.config/fish/config.fish \
"abbr --add --function multicd --regex '^\.\.+$' -- dotdot"
'';