less: migrate to lib.cli.toCommandLineGNU

Migrates from the deprecated toCommandLine to toCommandLineGNU.

This changes the output format to use GNU-style options with equals
(--wheel-lines=3). Both formats were verified to work correctly with less.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
Austin Horstman
2026-01-08 11:25:39 -06:00
parent 37158e5267
commit a2cc7b0bab
4 changed files with 4 additions and 4 deletions

View File

@@ -45,7 +45,7 @@ in
];
attrs = attrsOf (either scalar (listOf scalar));
in
coercedTo attrs (lib.cli.toGNUCommandLine { }) (listOf str);
coercedTo attrs (lib.cli.toCommandLineGNU { }) (listOf str);
default = [ ];
description = "Options to be set via {env}`$LESS`.";
example = {

View File

@@ -24,7 +24,7 @@
assertFileExists home-files/.config/lesskey
assertFileContent home-files/.config/lesskey ${builtins.toFile "lesskey.expected" ''
#env
LESS = --quiet --use-color --color HkK --color Mkb --prompt s%f
LESS = --quiet --use-color --color=HkK --color=Mkb --prompt=s%f
''}
'';
}

View File

@@ -23,7 +23,7 @@ in
assertFileExists home-files/.config/lesskey
assertFileContent home-files/.config/lesskey ${builtins.toFile "less.expected" ''
#env
LESS = --RAW-CONTROL-CHARS --quiet --wheel-lines 3 --wheel-lines 1
LESS = --RAW-CONTROL-CHARS --quiet --wheel-lines=3 --wheel-lines=1
${config}''}
'';

View File

@@ -15,7 +15,7 @@
assertFileExists home-files/.config/lesskey
assertFileContent home-files/.config/lesskey ${builtins.toFile "lesskey.expected" ''
#env
LESS = --RAW-CONTROL-CHARS --quiet --wheel-lines 3 --wheel-lines 1
LESS = --RAW-CONTROL-CHARS --quiet --wheel-lines=3 --wheel-lines=1
''}
'';
}