Skip to content

feat(more): parse extra args - #10696

Open
aaron-ang wants to merge 1 commit into
uutils:mainfrom
aaron-ang:more-extra-arg
Open

aaron-ang wants to merge 1 commit into
uutils:mainfrom
aaron-ang:more-extra-arg

Conversation

@aaron-ang

Copy link
Copy Markdown
Contributor

Parse +/, +, and - prefix for lines, from_line, and pattern args, based on manpage.

@github-actions

github-actions Bot commented Feb 3, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/tail/follow-name (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/shuf/shuf-reservoir (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/sort/sort-stale-thread-mem (passes in this run but fails in the 'main' branch)

@aaron-ang
aaron-ang force-pushed the more-extra-arg branch 3 times, most recently from 80746c3 to 26e6607 Compare February 4, 2026 14:23
@github-actions

github-actions Bot commented Feb 4, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

Note: The gnu test tests/seq/seq-epipe is now being skipped but was previously passing.

@github-actions

github-actions Bot commented Feb 4, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/shuf/shuf-reservoir (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/sort/sort-stale-thread-mem (fails in this run but passes in the 'main' branch)

@github-actions

github-actions Bot commented Feb 7, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/tail/inotify-dir-recreate (fails in this run but passes in the 'main' branch)

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/tail/symlink. tests/tail/symlink is passing on 'main'. Maybe you have to rebase?

@aaron-ang

aaron-ang commented May 10, 2026 •

Copy link
Copy Markdown
Contributor Author

@sylvestre could you please take a look? I've rebased on main and applied cleanups.

@github-actions

github-actions Bot commented May 10, 2026 •

Copy link
Copy Markdown

GNU testsuite comparison:

Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)
Skip an intermittent issue tests/pr/bounded-memory (was skipped on 'main', now failing)

@aaron-ang

aaron-ang commented May 11, 2026 •

Copy link
Copy Markdown
Contributor Author

Revised per offline review. The previous push wrongly preserved uutils-local flags. Confirmed against util-linux man page more(1): only -d -l -e -f -p -c -s -u -n, +number, +/string, -h, -V are GNU.

This push:

  • drops the --number alias entirely (not in GNU)
  • drops -F/-P short forms (not in GNU)
  • keeps --from-line/--pattern as hide(true) long flags — they remain the expansion targets for +number and +/pattern (internal only, omitted from --help)
  • mirrors the test changes from the original commit: drops the dropped flags' coverage; adds -d/-l/-e/-f long/short pairs and the new +N/+/pat cases
  • restores test_pattern_search and test_from_line_option to use +/ and + syntax only
  • removes the now-unused more-help-number translation key from en-US and fr-FR

more --help surface now matches GNU.

@sylvestre

Copy link
Copy Markdown
Contributor

hi, this one can't be merged as it is:

  • it needs a rebase
  • src/uu/more/src/parse.rs: this also rewrites args after --, so more -- +5 no longer opens a file named +5. please stop at -- and add a test
  • src/uu/more/src/parse.rs: more --pattern -5 gets turned into --pattern --lines 5 here, no?
  • src/uu/more/src/parse.rs: please use options::LINES / FROM_LINE / PATTERN instead of hardcoding the names again
  • src/uu/more/src/parse.rs: do we need the enum + this function? parse_extra_arg could directly return the flag and its value
  • src/uu/more/src/more.rs: same comment already on the constants, one is enough
    could you please have a look? otherwise, i will close it, thanks

@aaron-ang

Copy link
Copy Markdown
Contributor Author

thanks for the review @sylvestre. i've addressed all your points except point 2 about stopping at --:

util-linux more (2.39.3) doesn't stop there. more -- +3 file still starts at line 3, so more -- +5 doesn't open a file named +5 with util-linux either. i kept that behavior to match util-linux. do we intend to diverge?

Copilot AI balanced review requested due to automatic review settings October 19, 2026 00:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants