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

Stop execution on unrecognized flags, support arg terminator (--) #10

Merged

Conversation

ninedotnine
Copy link
Contributor

@ninedotnine ninedotnine commented May 21, 2022

Deleting files when the given args are invalid is risky behaviour;
what if the user intended -i but typed -j?

This commit improves compatibility with GNU rm.

closes #9

edit:

Support filenames beginning with `-`

Arguments appearing after the argument terminator (`--`)
will now be treated as filenames.

Note that the check for arguments beginning with `-`
can be removed because the previous commit (bd304db)
effectively moved that check to the argument-parser.

This commit improves compatibility with GNU rm.

closes #8

Deleting files when the given args are invalid is risky behaviour;
what if the user intended `-i` but typed `-j`?

This commit improves compatibility with GNU rm.
Arguments appearing after the argument terminator (`--`)
will now be treated as filenames.

Note that the check for arguments beginning with `-`
can be removed because the previous commit (bd304db)
effectively moved that check to the argument-parser.

This commit improves compatibility with GNU rm.
@ninedotnine ninedotnine changed the title Stop execution on unrecognized flags Stop execution on unrecognized flags, support arg terminator (--) May 22, 2022
@rushsteve1 rushsteve1 merged commit 70a0207 into rushsteve1:main May 24, 2022
@ninedotnine ninedotnine deleted the danso/error-on-unrecognized-flags branch May 24, 2022 18:10
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.

unrecognized flags reported, but execution continues anyway unable to delete files beginning with -
2 participants