Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

diff: options handling improvements #371

Merged
merged 1 commit into from
Dec 10, 2023
Merged

Conversation

mknos
Copy link
Contributor

@mknos mknos commented Dec 10, 2023

  • Usage string: '|' before -e was missing
  • Usage string: -q flag was missing
  • Error message for >2 arguments incorrectly stated that arguments were missing
  • When checking $opt_q we don't need to check @$diffs a second time
  • Detect incompatible options with set_diff_type() which only allows default type of OLD to be overridden
  • -U10 overrides -u and -C10 overrides -c (previously the final option wins the race)
  • Introduce a regular usage() function
  • Supported diff types...
    perl diff a b # diff_type=OLD context=0
    perl diff -c a b # diff_type=CONTEXT context=3
    perl diff -C10 a b # diff_type=CONTEXT context=10
    perl diff -e a b # diff_type=ED context=0
    perl diff -f a b # diff_type=REVERSE_ED context=0
    perl diff -q a b # diff_type=ED context=0 (exit early compared to -e)
    perl diff -u a b # diff_type=UNIFIED context=3
    perl diff -U10 a b # diff_type=UNIFIED context=10

* Usage string: '|' before -e was missing
* Usage string: -q flag was missing
* Error message for >2 arguments incorrectly stated that arguments were missing
* When checking $opt_q we don't need to check @$diffs a second time
* Detect incompatible options with set_diff_type() which only allows default type of OLD to be overridden
* -U10 overrides -u and -C10 overrides -c (previously the final option wins the race)
* Introduce a regular usage() function
@github-actions github-actions bot added Type: enhancement improve a feature that already exists Priority: low get to this whenever Program: diff The diff program labels Dec 10, 2023
@briandfoy briandfoy self-assigned this Dec 10, 2023
@briandfoy briandfoy merged commit dcffaec into briandfoy:master Dec 10, 2023
2 checks passed
@briandfoy briandfoy added Status: accepted The fix is accepted and removed Priority: low get to this whenever labels Dec 10, 2023
@briandfoy briandfoy added Status: released there is a new release with this fix and removed Status: accepted The fix is accepted labels Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Program: diff The diff program Status: released there is a new release with this fix Type: enhancement improve a feature that already exists
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants