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

rm: raise error for long options #632

Merged
merged 1 commit into from
May 31, 2024
Merged

Conversation

mknos
Copy link
Contributor

@mknos mknos commented May 31, 2024

  • I noticed that if I provide "long" options to rm, it gets confused and attempts to remove files starting with a dash
  • When debugging this, preprocess_options() was incorrectly deciding to save long options into new_args list; call usage() instead because this rm only supports single letter options
%perl rm --this    # before patch
rm: cannot remove '-t': No such file or directory
rm: cannot remove '-h': No such file or directory
rm: cannot remove '-i': No such file or directory
rm: cannot remove '-s': No such file or directory

* I noticed that if I provide "long" options to rm, it gets confused and attempts to remove files starting with a dash
* When debugging this, preprocess_options() was incorrectly deciding to save long options into new_args list; call usage() instead because this rm only supports single letter options

%perl rm --this    # before patch
rm: cannot remove '-t': No such file or directory
rm: cannot remove '-h': No such file or directory
rm: cannot remove '-i': No such file or directory
rm: cannot remove '-s': No such file or directory
@github-actions github-actions bot added Type: enhancement improve a feature that already exists Priority: low get to this whenever Program: rm The rm program labels May 31, 2024
@briandfoy
Copy link
Owner

changes: disable "long" options; single letter options only

@briandfoy briandfoy merged commit ddc35c7 into briandfoy:master May 31, 2024
2 checks passed
@briandfoy briandfoy added Status: accepted The fix is accepted Type: bug an existing feature does not work and removed Priority: low get to this whenever Type: enhancement improve a feature that already exists labels May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Program: rm The rm program Status: accepted The fix is accepted Type: bug an existing feature does not work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants