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

Show type as mandatory arg in conn get help #679

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

pau-hedgehog
Copy link
Contributor

Improve UX highlighting <type> as required in the CLI to avoid hitting

core@control-1 ~ $ kubectl fabric conn get
14:56:16 ERR Failed err="failed to get connections: type is required"
core@control-1 ~ $ kubectl fabric conn 
NAME:
   kubectl fabric connection - Connection commands

USAGE:
   kubectl fabric connection command <type> [command options] 

@pau-hedgehog pau-hedgehog self-assigned this Nov 27, 2024
@@ -392,6 +392,8 @@ func main() {
{
Name: "get",
Usage: "Get connections",
ArgsUsage: "<type>",
Description: "Available types: fabric, external, etc", // TODO: get full list from model
Copy link
Member

Choose a reason for hiding this comment

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

It currently only have a custom behaviour for management, fabric, vpc-loopback. Everything else is just kubectl get conn, so, you can explicitly list only those 3.

https://github.com/githedgehog/fabric/blob/master/pkg/hhfctl/connection.go

@pau-hedgehog pau-hedgehog force-pushed the hhfctl_get_conn_usage branch 3 times, most recently from 45eab57 to 213fdc3 Compare December 3, 2024 18:55
@pau-hedgehog pau-hedgehog marked this pull request as ready for review December 3, 2024 19:04
@pau-hedgehog pau-hedgehog changed the title add type as mandatory arg in conn get help Show type as mandatory arg in conn get help Dec 3, 2024
@pau-hedgehog pau-hedgehog marked this pull request as draft December 3, 2024 21:32
@pau-hedgehog
Copy link
Contributor Author

This is the best I could get:

pau@fedora:~/fabric$ ./bin/hhfctl connection get --help
NAME:
   hhfctl connection get - Get connections

USAGE:
   hhfctl connection get [command options] <type>

DESCRIPTION:
   Available types: management, fabric, and vpc-loopback

OPTIONS:
   --verbose, -v  verbose output (includes debug) (default: true)
   --help, -h     show help

@Frostman
Copy link
Member

Frostman commented Dec 4, 2024

@pau-hedgehog I think it's good, let's have it

@Frostman Frostman marked this pull request as ready for review December 4, 2024 06:21
@Frostman Frostman merged commit b843c04 into master Dec 4, 2024
6 checks passed
@Frostman Frostman deleted the hhfctl_get_conn_usage branch December 4, 2024 06:21
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.

2 participants