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

Check CLI args for commands that do not need them #1941

Closed
carpawell opened this issue Oct 20, 2022 · 0 comments · Fixed by #2525
Closed

Check CLI args for commands that do not need them #1941

carpawell opened this issue Oct 20, 2022 · 0 comments · Fixed by #2525
Assignees
Labels
bug Something isn't working good first issue Good for newcomers neofs-adm NeoFS Adm application issues neofs-cli NeoFS CLI application issues U4 Nothing urgent
Milestone

Comments

@carpawell
Copy link
Member

Context

Technically correct usage:

neofs-cli object put test test test test -r <...> -w <...> ...

Example

A real example of a logically incorrect usage that did not return any error:

neofs-cli object hash range 0:11 <...>

instead of

neofs-cli object hash --range 0:11 <...>

Reason

We do not check cobra's args if we do not use them.

Suggestion

Check their presence and return an error if they are found but not expected.

@carpawell carpawell added discussion Open discussion of some problem triage neofs-cli NeoFS CLI application issues U4 Nothing urgent labels Oct 20, 2022
@roman-khimov roman-khimov added the good first issue Good for newcomers label Apr 23, 2023
@roman-khimov roman-khimov added bug Something isn't working neofs-adm NeoFS Adm application issues and removed discussion Open discussion of some problem triage labels Aug 16, 2023
@roman-khimov roman-khimov added this to the v0.39.0 milestone Aug 16, 2023
AliceInHunterland added a commit that referenced this issue Aug 24, 2023
Added cobra's check if positional arguments to prevent logically incorrect argument usage and passing redundant arguments to the commands.

Closes #1941.

Signed-off-by: Ekaterina Pavlova <[email protected]>
AliceInHunterland added a commit that referenced this issue Aug 24, 2023
Added cobra's check if positional arguments to prevent logically
incorrect argument usage and passing redundant arguments to the commands.

Closes #1941.

Signed-off-by: Ekaterina Pavlova <[email protected]>
AliceInHunterland added a commit that referenced this issue Aug 24, 2023
Added cobra's check if positional arguments to prevent logically
incorrect argument usage and passing redundant arguments to the commands.

Closes #1941.

Signed-off-by: Ekaterina Pavlova <[email protected]>
@roman-khimov roman-khimov modified the milestones: v0.39.0, v0.38.0 Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers neofs-adm NeoFS Adm application issues neofs-cli NeoFS CLI application issues U4 Nothing urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants