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

error if multiple files are supplied to import command #142

Merged
merged 2 commits into from
Jul 15, 2024

Conversation

sofuture
Copy link
Contributor

Changelog

Correctly error when multiple files are supplied to the import command.

Docs

None

Description

Only one file can be imported at a time per command invocation. Explicitly reject multiple arguments.

BeforeAfter

Fixes: FG-8204

Copy link

linear bot commented Jul 15, 2024

@sofuture sofuture marked this pull request as ready for review July 15, 2024 19:02
Copy link
Contributor

@bryfox bryfox left a comment

Choose a reason for hiding this comment

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

This works.

You could use an Args validator instead (and drop both length checks); we use it in another spot, so might be good for consistency. On the other hand, the error messaging isn't as specific.

Args: cobra.ExactArgs(1),

@sofuture
Copy link
Contributor Author

I think that's a better approach.

@sofuture sofuture merged commit 37606a9 into main Jul 15, 2024
4 checks passed
@sofuture sofuture deleted the jz/fix-multiple-file-upload-silent-failure branch July 15, 2024 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants