-
Notifications
You must be signed in to change notification settings - Fork 22
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
Refactor commands and CLI options #110
Conversation
Rebased and ready to go 🚀 |
if opts.Product != "" && opts.Product != args[i] { | ||
return errors.New("product can only be specified once") | ||
} | ||
opts.Product = args[i] | ||
case 1: | ||
if opts.Vulnerability != "" && opts.Vulnerability != args[i] { | ||
return errors.New("vulnerability can only be specified once") | ||
} | ||
opts.Vulnerability = args[i] | ||
case 2: | ||
if opts.Status != "" && opts.Status != args[i] { | ||
return errors.New("status can only be specified once") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we ask for these values both as flags and as positional args? I'm wondering if that ambiguity hinders the clarity of the CLI UX a bit 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has its origins back when vexctl supported more than one product on create
, etc. You can quickly define one of them using the params or have more control with the flags. We could change it later if it makes more sense but it is a breaking change and we need to deprecate one of the mechanisms and notify users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, thanks for the context. This certainly doesn't block this PR. It might be worth thinking about a UX "audit" at some point in the future and deciding what deprecations make sense as you think about what your vision is for the CLI.
This commit refactors the vexctl commands and commits to enable better reuse in preparation for new vexctl subcommands that are coming really soon. Signed-off-by: Adolfo García Veytia (Puerco) <[email protected]>
Signed-off-by: Adolfo García Veytia (Puerco) <[email protected]>
Signed-off-by: Adolfo García Veytia (Puerco) <[email protected]>
Signed-off-by: Adolfo Garcia Veytia (puerco) <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
This PR refactors the
vexctl
commands and CLI options for better reuse across the CLI in preparation for new subcommands that are coming really soon.Note: Requires #92 and a rebase(merged)Signed-off-by: Adolfo García Veytia (Puerco) [email protected]