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

[FEATURE] Add bpt repo remove --if-missing={ignore,fail} #130

Open
maxtruxa opened this issue Jun 9, 2022 · 1 comment
Open

[FEATURE] Add bpt repo remove --if-missing={ignore,fail} #130

maxtruxa opened this issue Jun 9, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@maxtruxa
Copy link
Contributor

maxtruxa commented Jun 9, 2022

Describe the scenario and circumstances that should be addressed

While it "feels" good that bpt repo remove doesn't report an error when the package to be removed doesn't exist anyways, it's also easy to mistype the package ID without being informed about it.

Describe the solution you'd like

Introduce a new --if-missing option to bpt repo remove, similar to bpt repo import --if-exists. Possible values might be ignore (same behavior as right now) and fail (which should issue an error if the package doesn't exist).

IMO the default behavior should be changed to fail as well because it's the safer default, but that I don't care about as much.

Additional context

I'm currently working on an HTTP API for a bpt repo and intend to report an error if the client attempts to delete a non-existent package (except if the client explicitly states that it doesn't care). The current workaround is checking that the package exists through bpt repo ls before attempting to remove it. This feels clunky, has to be manually guarded against races, and obviously doesn't help CLI usage of bpt.

@maxtruxa maxtruxa added the enhancement New feature or request label Jun 9, 2022
@maxtruxa maxtruxa changed the title [FEATURE] bpt repo remove should have a --if-missing option [FEATURE] Add bpt repo remove --if-missing={ignore,fail} Jun 9, 2022
@vector-of-bool
Copy link
Owner

This has bitten me a few times. It is reasonable to add this.

@vector-of-bool vector-of-bool added this to the Beta 1 milestone Jun 9, 2022
@vector-of-bool vector-of-bool self-assigned this Jun 9, 2022
vector-of-bool added a commit that referenced this issue Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants