Skip to content

pr: incorrectly interprets argument to -n #10302

Open

Description

@jfinkels

Environment: uutils main branch (git commit 799de29), GNU pr version 9.9

Steps to reproduce:

echo "abc" > f && pr -n f

What happens now: uutils pr waits for user input on stdin.

What I expected to happen: GNU pr correctly renders the file f with line numbers:



2026-01-17 21:36                        f                         Page 1


    1   abc

<truncated lots of blank lines below...>

Notes: I believe uutils pr is incorrectly interpreting the argument f as the argument to -n.

Activity

  1. my4ng commented on Feb 3, 2026

    @my4ng
    Contributor

    IMO the bigger issue is that currently there is no mechanism in clap to disambiguate between -n 5 and -n=5 and -n5. While Arg::require_equals works here for the first case, such that 5 is not parsed as the option value, -n=5 fails such that = is not parsed as the separator as intended:

    echo "abc" > f && pr -n=5 f

    GNU:

    
    
    2026-02-03 18:24                        f                         Page 1
    
    
        1=abc
    

    uutils:

    
    
    2026-02-03 18:25                        f                         Page 1
    
    
        1	abc
    

    Related to: clap-rs/clap#5489

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions