-
Notifications
You must be signed in to change notification settings - Fork 6
feat(docs): add subcommand for opening documentation #186
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
Conversation
|
Tagged for reviews. I wasn't sure if I liked |
|
Thanks for doing this @amoeba. I prefer |
|
Changed from "doc" to "docs" in daadd80. @ianmcook do you want to take it for a test drive and @zeroshade do you want to check my implementation (code and tests)? |
|
Thanks @amoeba, this is great. I'm wondering if we really need the |
|
I wasn't sure which I preferred and found I didn't have a lot of prior art to pull from. Another example is R in some cases (like Windows) and it doesn't prompt IIRC. The only other examples I could think of were some of the CLIs that do auth and those prompt but usually they are giving you instructions and sometimes a code to copy paste. I'll rework this to not prompt and add a |
|
This is all refactored now. It now just opens the URL without prompting or printing anything to the terminal. And it also supports a $ go run ./cmd/dbc docs --no-open
dbc docs are available at the following URL:
https://docs.columnar.tech/dbc/
~/src/columnar-tech/dbc feat/subcommand--doc
$ go run ./cmd/dbc docs sqlite --no-open
sqlite driver docs are available at the following URL:
https://arrow.apache.org/adbc/current/driver/sqlite.html
~/src/columnar-tech/dbc feat/subcommand--doc
$ go run ./cmd/dbc docs bigquery --no-open
Error: no documentation available for driver `bigquery`
exit status 1I went with |
|
CI seems good, I manually tested on Windows just to be sure the package we're using is as cross-platform as they say they are. It seems to work :) Ready for a final review @ianmcook |
|
Since this is a new subcommand, do we need to change anything in the shell completions? |
|
Good call. We should do that during release. I'll go make sure that's in our checklist. |
ianmcook
left a comment
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.
Thanks for doing this!
Adds the implementation and documentation for a new subcommand,
docs.If you run
dbc docswith no driver, the main dbc docs site opens in your default browser. If you rundbc docs DRIVER, we look for that driver in the driver registry (the CDN). If not found, we error. If found, we look in a list of temporary, fallback URLs for a docs URL and open that. For drivers that exist in the registry but have no fallback URL, we error.Closes #176