From efd70842f3e0b216c622e407aedb44b7e52d1ace Mon Sep 17 00:00:00 2001 From: Charlie Tonneslan Date: Sat, 16 May 2026 19:29:00 -0400 Subject: [PATCH] more: swap -f and -l short flags to match GNU/util-linux The clap definition had -l mapped to --logical and -f mapped to --no-pause, which is the reverse of how util-linux more works. The help strings on each long option were also describing the other one, so the only thing that was internally consistent was the long names. Real more: -f, --logical Count logical lines, rather than screen lines -l, --no-pause Suppress pausing after form feed (^L) Fix the short flag assignments and the en-US/fr-FR help strings. Both options are still no-ops behavior-wise (still marked as unimplemented), but at least the CLI surface is right. For #2320. Signed-off-by: Charlie Tonneslan --- src/uu/more/locales/en-US.ftl | 4 ++-- src/uu/more/locales/fr-FR.ftl | 4 ++-- src/uu/more/src/more.rs | 4 ++-- tests/by-util/test_more.rs | 4 ++++ 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/uu/more/locales/en-US.ftl b/src/uu/more/locales/en-US.ftl index 4743d1ebaf7..75546753280 100644 --- a/src/uu/more/locales/en-US.ftl +++ b/src/uu/more/locales/en-US.ftl @@ -12,9 +12,9 @@ more-error-unknown-key = Unknown key: '{$key}'. Press 'h' for instructions. (uni # Help messages more-help-silent = Display help instead of ringing bell when an illegal key is pressed -more-help-logical = Do not pause after any line containing a ^L (form feed) +more-help-logical = Count logical lines, rather than screen lines more-help-exit-on-eof = Exit on End-Of-File -more-help-no-pause = Count logical lines, rather than screen lines +more-help-no-pause = Do not pause after any line containing a ^L (form feed) more-help-print-over = Do not scroll, clear screen and display text more-help-clean-print = Do not scroll, display text and clean line ends more-help-squeeze = Squeeze multiple blank lines into one diff --git a/src/uu/more/locales/fr-FR.ftl b/src/uu/more/locales/fr-FR.ftl index 69766f2c620..17e1bc9e1d6 100644 --- a/src/uu/more/locales/fr-FR.ftl +++ b/src/uu/more/locales/fr-FR.ftl @@ -12,9 +12,9 @@ more-error-unknown-key = Touche inconnue : '{$key}'. Appuyez sur 'h' pour les in # Messages d'aide more-help-silent = Afficher l'aide au lieu de sonner la cloche lorsqu'une touche illégale est pressée -more-help-logical = Ne pas faire de pause après une ligne contenant un ^L (saut de page) +more-help-logical = Compter les lignes logiques plutôt que les lignes d'écran more-help-exit-on-eof = Quitter à la fin du fichier -more-help-no-pause = Compter les lignes logiques plutôt que les lignes d'écran +more-help-no-pause = Ne pas faire de pause après une ligne contenant un ^L (saut de page) more-help-print-over = Ne pas défiler, effacer l'écran et afficher le texte more-help-clean-print = Ne pas défiler, afficher le texte et nettoyer les fins de ligne more-help-squeeze = Compresser plusieurs lignes vides en une seule diff --git a/src/uu/more/src/more.rs b/src/uu/more/src/more.rs index 32c416a2073..c0e700c4ba1 100644 --- a/src/uu/more/src/more.rs +++ b/src/uu/more/src/more.rs @@ -221,7 +221,7 @@ pub fn uu_app() -> Command { ) .arg( Arg::new(options::LOGICAL) - .short('l') + .short('f') .long(options::LOGICAL) .action(ArgAction::SetTrue) .help(translate!("more-help-logical")), @@ -235,7 +235,7 @@ pub fn uu_app() -> Command { ) .arg( Arg::new(options::NO_PAUSE) - .short('f') + .short('l') .long(options::NO_PAUSE) .action(ArgAction::SetTrue) .help(translate!("more-help-no-pause")), diff --git a/tests/by-util/test_more.rs b/tests/by-util/test_more.rs index 1df3e06b085..f73a397ce8b 100644 --- a/tests/by-util/test_more.rs +++ b/tests/by-util/test_more.rs @@ -79,6 +79,10 @@ fn test_valid_arg() { &["--from-line", "0"], &["-P", "something"], &["--pattern", "-1"], + &["-f"], + &["--logical"], + &["-l"], + &["--no-pause"], ]; for args in args_list { test_alive(args);