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

cmp: 2-argument minimum #465

Merged
merged 1 commit into from
Feb 15, 2024
Merged

cmp: 2-argument minimum #465

merged 1 commit into from
Feb 15, 2024

Conversation

mknos
Copy link
Contributor

@mknos mknos commented Feb 15, 2024

  • Usage string states that file1 and file2 are required
  • Standards document indicates file2 is not supposed to be inferred as stdin [1]
  • Either file1 or file2 can be specified as '-' for comparison against stdin
  • test1: error: no args: perl cmp
  • test2: error: bad option: perl cmp -x
  • test3: error: file2 omitted: perl cmp test.txt
  • test4: error: two stdins: perl cmp - -
  • test5: compare stdin with file bc: echo '#!/user/bing' | perl cmp - bc
  • test6: skip 1 byte of file1: perl cmp ar awk 1
  • test7: skip 1 byte of file1 and file2: perl cmp ar awk 1 1
  • test8: error: too many args: perl cmp ar awk 1 1 1
  1. https://pubs.opengroup.org/onlinepubs/009604499/utilities/cmp.html

* Usage string states that file1 and file2 are required
* Standards document indicates file2 is not supposed to be inferred as stdin [1]
* Either file1 or file2 can be specified as '-' for comparison against stdin
* test1: error: no args: perl cmp
* test2: error: bad option: perl cmp -x 
* test3: error: file2 omitted: perl cmp test.txt
* test4: error: two stdins: perl cmp - -
* test5: compare stdin with file bc: echo '#!/user/bing' | perl cmp - bc
* test6: skip 1 byte of file1: perl cmp ar awk 1
* test7: skip 1 byte of file1 and file2: perl cmp ar awk 1 1
* test8: error: too many args: perl cmp ar awk 1 1 1

1. https://pubs.opengroup.org/onlinepubs/009604499/utilities/cmp.html
@github-actions github-actions bot added Type: enhancement improve a feature that already exists Priority: low get to this whenever Program: cmp The cop program labels Feb 15, 2024
@briandfoy briandfoy self-assigned this Feb 15, 2024
@briandfoy briandfoy merged commit 3a70a5a into briandfoy:master Feb 15, 2024
1 of 2 checks passed
@briandfoy briandfoy added Status: accepted The fix is accepted and removed Priority: low get to this whenever labels Feb 15, 2024
@briandfoy
Copy link
Owner

changes: require at least two arguments

@briandfoy briandfoy added Status: released there is a new release with this fix and removed Status: accepted The fix is accepted labels Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Program: cmp The cop 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