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

Do not show usage error for --all flag #960

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

demusdev
Copy link
Contributor

Description

When --all flag is set for the repo delete command, and there are no repositories to delete, do not shoow usage error.

Before

Screenshot 2024-11-14 at 19 54 03

After

Screenshot 2024-11-14 at 19 44 15

Checklist before requesting a review

When --all flag is set for the `repo delete` command,
and there are no repositories to delete, do not shoow usage error.
Copy link
Member

@s373r s373r left a comment

Choose a reason for hiding this comment

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

Added minor comments

Comment on lines +49 to +54
if self.names.is_empty() && !self.all {
return Err(CLIError::usage_error(
"Specify a repository or use --all flag",
));
}

Copy link
Member

Choose a reason for hiding this comment

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

Please use (override) Command::validate_args() for this check

Copy link
Member

Choose a reason for hiding this comment

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

Also, I think we should work through all the variations

  1. no names & no --all
  2. no names & --all
  3. some names & no --all
  4. some names & --all

I think some of these options are redundant and an error message should be provided for them

Copy link
Member

Choose a reason for hiding this comment

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

Optional: add E2E tests -- Here it would be great to check our errors (output messages)

PS. I'd like to help make these, if you decide to make them, let me know and I'll advise on the best way to approach it

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.

2 participants