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

cli: Use MarkFlagsOneRequired for mutex but required flags #2763

Merged
merged 1 commit into from
Mar 6, 2024

Conversation

cthulhu-rider
Copy link
Contributor

No description provided.

Copy link

codecov bot commented Mar 5, 2024

Codecov Report

Attention: Patch coverage is 22.22222% with 7 lines in your changes are missing coverage. Please review.

Project coverage is 22.04%. Comparing base (14b650c) to head (8883373).
Report is 4 commits behind head on master.

Files Patch % Lines
cmd/neofs-cli/modules/bearer/create.go 0.00% 1 Missing ⚠️
cmd/neofs-cli/modules/control/evacuate_shard.go 0.00% 1 Missing ⚠️
cmd/neofs-cli/modules/control/flush_cache.go 0.00% 1 Missing ⚠️
cmd/neofs-cli/modules/control/shards_set_mode.go 0.00% 1 Missing ⚠️
cmd/neofs-cli/modules/object/lock.go 0.00% 1 Missing ⚠️
cmd/neofs-cli/modules/session/create.go 0.00% 1 Missing ⚠️
cmd/neofs-cli/modules/storagegroup/put.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2763   +/-   ##
=======================================
  Coverage   22.03%   22.04%           
=======================================
  Files         787      787           
  Lines       46763    46751   -12     
=======================================
  Hits        10304    10304           
+ Misses      35576    35564   -12     
  Partials      883      883           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

The feature came with github.com/spf13/cobra@v1.8.0. We don't need to do
manual checks with it. For example, following command result changed
from:
```
$ neofs-cli bearer create -i 1 -n 2 --out b -o c
expiration epoch or lifetime period is required
```
to
```
Error: at least one of the flags in the group [expire-at lifetime] is required
```

Ret code remains = 1. Below are command checklists.
CLI:
 * `bearer create`;
 * `control shards evacuate`;
 * `control shards flush-cache`;
 * `control shards set-mode`;
 * `object lock`;
 * `session create`;
 * `storagegroup put`.
ADM:
 * `morph verified-nodes-domain set-access-list`;
 * `morph refill-gas`.

Closes #2595.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
@cthulhu-rider cthulhu-rider merged commit e64483d into master Mar 6, 2024
14 of 16 checks passed
@cthulhu-rider cthulhu-rider deleted the 2595-cli-oneof-flag branch March 6, 2024 09:07
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.

3 participants