From b8d186abf8e14b3cffc8e0aee6459a323bc83eb0 Mon Sep 17 00:00:00 2001 From: Karun Sandhu <129101708+MrSom3body@users.noreply.github.com> Date: Sun, 20 Apr 2025 07:23:07 +0200 Subject: [PATCH] fish: allow multiple commands for command option in abbreviations (#6851) --- modules/programs/fish.nix | 2 +- tests/modules/programs/fish/abbrs.nix | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/programs/fish.nix b/modules/programs/fish.nix index e9613539..689fc41c 100644 --- a/modules/programs/fish.nix +++ b/modules/programs/fish.nix @@ -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 diff --git a/tests/modules/programs/fish/abbrs.nix b/tests/modules/programs/fish/abbrs.nix index c026c3c2..030d65c3 100644 --- a/tests/modules/programs/fish/abbrs.nix +++ b/tests/modules/programs/fish/abbrs.nix @@ -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" '';