-
Notifications
You must be signed in to change notification settings - Fork 42
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
Changes to urfave CLI, implements version command and one-page doc #218
Conversation
@@ -1,120 +1,25 @@ | |||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= |
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.
283 lines gone from the go.sum file
github.com/stretchr/testify v1.7.0 | ||
github.com/tklauser/go-sysconf v0.3.5 // indirect | ||
github.com/ulikunitz/xz v0.5.10 // indirect | ||
github.com/urfave/cli/v2 v2.3.0 |
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.
Based on the reduction of transitive dependencies, switching to urfave CLI seems like a nice win. IMO the docs for urfave CLI are well written and the native support for environment variables is a nice add.
|
||
debug.EnableAll(r) | ||
|
||
envoyArgs := args[1:] | ||
return r.Run(c.Context(), envoyArgs) | ||
envoyArgs := findEnvoyArgs(args) |
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.
I like the clarity of this 👍
7d0061c
to
3535a18
Compare
I will try to finish this tomorrow morning asia time |
This changes to urlfave CLI, implements version command and makes markdown a single doc. Urlfave is easier and implements ENV variables natively. It also supports auto-complete and man page generation. Finally, it has significantly less dependencies (as noticable in the go.sum results). Signed-off-by: Adrian Cole <adrian@tetrate.io>
once this is merged, I will help simplify the getenvoy.io usage of "getenvoy doc" to emit the now much simpler single page. This should suffice, but if we later feel we want to edit it, we can override the template like so https://github.com/google/skia-buildbot/blob/4c87209ff9378a9befc65d5f93c4040d4fdd5922/go/urfavecli/urfavecli.go#L34 eventually, we should make markdown completely driven by the website code instead of a routing through a hidden command as mentioned in #205 |
Signed-off-by: Adrian Cole <adrian@tetrate.io>
Signed-off-by: Adrian Cole <adrian@tetrate.io>
I have a WIP branch for the website that correctly renders now https://github.com/tetratelabs/getenvoy.io/compare/new-usage |
Co-authored-by: Takeshi Yoneda <takeshi@tetrate.io>
Signed-off-by: Adrian Cole <adrian@tetrate.io>
thanks for the review @llinder and @mathetake! |
This changes to urfave CLI, which is easier to work with than Cobra.
Pros of both:
Pros of urfave:
Before
instead ofPersistentPreRunE
)Cons of urfave
<reference>
and then anything passed to envoy-- .*
, so this isn't a biggiehttps://github.com/urfave/cli/blob/master/docs/v2/manual.md