Repository navigation
feat(docs): add subcommand for opening documentation - #186
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. |
Adds the implementation and documentation for a new subcommand, `docs`. If you run `dbc docs` with no driver, the main dbc docs site opens in your default browser. If you run `dbc 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
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