File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed
tests/modules/programs/fish Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 166166
167167 abbrModule = types . submodule {
168168 options = {
169+ name = mkOption {
170+ type = with types ; nullOr str ;
171+ default = null ;
172+ description = ''
173+ The abbreviation name that is replaced by the expansion.
174+ '' ;
175+ } ;
176+
169177 expansion = mkOption {
170178 type = with types ; nullOr str ;
171179 default = null ;
289297
290298 abbrsStr = lib . concatStringsSep "\n " (
291299 lib . mapAttrsToList (
292- name : def :
300+ attrName : def :
293301 let
302+ name = if isAttrs def && def . name != null then def . name else attrName ;
294303 mods =
295304 lib . cli . toGNUCommandLineShell
296305 {
Original file line number Diff line number Diff line change 3939 command = "git" ;
4040 expansion = "checkout" ;
4141 } ;
42- s = {
42+ status = {
43+ name = "s" ;
4344 command = [
4445 "git"
4546 "hg"
4647 ] ;
4748 expansion = "status" ;
4849 } ;
50+ show = {
51+ name = "s" ;
52+ command = "systemctl" ;
53+ expansion = "show" ;
54+ } ;
4955 dotdot = {
5056 regex = "^\\ .\\ .+$" ;
5157 function = "multicd" ;
7985 "abbr --add --command git -- co checkout"
8086 assertFileContains home-files/.config/fish/config.fish \
8187 "abbr --add --command git --command hg -- s status"
88+ assertFileContains home-files/.config/fish/config.fish \
89+ "abbr --add --command systemctl -- s show"
8290 assertFileContains home-files/.config/fish/config.fish \
8391 "abbr --add --function multicd --regex '^\.\.+$' -- dotdot"
8492 '' ;
You can’t perform that action at this time.
0 commit comments