-
-
Notifications
You must be signed in to change notification settings - Fork 65
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 CLI #154
Refactor CLI #154
Conversation
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.
Awesome!
Left a few minor comments.
Readme.md
Outdated
@@ -80,6 +80,7 @@ make prepare | |||
make test-conformance | |||
|
|||
# Run integration benchmarks | |||
npm i -g websocket-bench |
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.
We're using https://github.com/anycable/websocket-bench
npm i -g websocket-bench | |
go install github.com/anycable/websocket-bench@latest |
Makefile
Outdated
@@ -118,7 +118,7 @@ test-conformance-http: tmp/anycable-go-test | |||
BUNDLE_GEMFILE=.circleci/Gemfile ANYCABLE_BROADCAST_ADAPTER=http ANYCABLE_HTTP_BROADCAST_SECRET=any_secret bundle exec anyt -c "tmp/anycable-go-test --headers=cookie,x-api-token" --target-url="ws://localhost:8080/cable" | |||
|
|||
test-conformance-nats: tmp/anycable-go-test | |||
BUNDLE_GEMFILE=.circleci/Gemfile ANYCABLE_BROADCAST_ADAPTER=nats bundle exec anyt -c "tmp/anycable-go-test --headers=cookie,x-api-token" --target-url="ws://localhost:8080/cable" | |||
BUNDLE_GEMFILE=.circleci/Gemfile ANYCABLE_BROADCAST_ADAPTER=nats ANYCABLE_MNATS_ENABLE=true bundle exec anyt -c "tmp/anycable-go-test --headers=cookie,x-api-token" --target-url="ws://localhost:8080/cable" |
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.
BUNDLE_GEMFILE=.circleci/Gemfile ANYCABLE_BROADCAST_ADAPTER=nats ANYCABLE_MNATS_ENABLE=true bundle exec anyt -c "tmp/anycable-go-test --headers=cookie,x-api-token" --target-url="ws://localhost:8080/cable" | |
BUNDLE_GEMFILE=.circleci/Gemfile ANYCABLE_BROADCAST_ADAPTER=nats bundle exec anyt -c "tmp/anycable-go-test --headers=cookie,x-api-token" --target-url="ws://localhost:8080/cable" |
cli/cli_flags.go
Outdated
@@ -0,0 +1,521 @@ | |||
package cli |
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.
Let's call this file options.go
(to preserve the original name and avoid cli/cli_xx
).
c115903
to
44d56f8
Compare
cli/options.go
Outdated
Name: "redis_url", | ||
Usage: "Redis url", | ||
Value: c.Redis.URL, | ||
EnvVars: []string{"ANYCABLE_REDIS_URL", "REDIS_URL"}, |
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.
What about prepending prefixed env to the list of passed EnvVars if they defined?
This way, all the prefixed envs would be handled automatically in one place.
44d56f8
to
76be46b
Compare
76be46b
to
f5373c0
Compare
What is the purpose of this pull request?
Refactor cli namespace.
What changes did you make? (overview)
github.com/urfave/cli/v2
.Checklist