databricks-cli/libs/databrickscfg
Miles Yucht f203731fe6
Support tab completion for profiles (#572)
## Changes
Currently, `databricks --profile <TAB>` autocompletes with the shell
default behavior, listing files in the local directory. This is not a
great experience. Especially given that the suggested profile names for
accounts are so long, it can be cumbersome to type them out by hand.
This PR configures autocompletion for `--profile` to inspect the
profiles of ~/.databrickscfg.

One potential improvement is to filter the response based on whether the
command is known to be account-level or workspace-level.

## Tests
Manual test.
<img width="579" alt="Screenshot_11_07_2023__18_31"
src="https://github.com/databricks/cli/assets/1850319/d7a3acd0-2511-45ac-bd82-95567775c10a">
2023-07-12 12:05:51 +02:00
..
testdata Add profile on `databricks auth login` (#423) 2023-06-02 13:49:39 +02:00
host.go Try to resolve a profile if only the host is specified (#287) 2023-03-29 20:44:19 +02:00
host_test.go Try to resolve a profile if only the host is specified (#287) 2023-03-29 20:44:19 +02:00
loader.go Follow up to #513 (#521) 2023-06-23 12:51:31 +02:00
loader_test.go Add profile on `databricks auth login` (#423) 2023-06-02 13:49:39 +02:00
ops.go Follow up to #513 (#521) 2023-06-23 12:51:31 +02:00
ops_test.go Include [DEFAULT] section header when writing ~/.databrickscfg (#464) 2023-06-13 16:41:56 +00:00
profiles.go Support tab completion for profiles (#572) 2023-07-12 12:05:51 +02:00
profiles_test.go Tweak profile prompt (#454) 2023-06-09 13:56:35 +02:00