|
16 | 16 | - [Runtime Dependencies](#runtime-dependencies)
|
17 | 17 | - [Recommended setup](#recommended-setup)
|
18 | 18 | - [Installation](#installation)
|
| 19 | + - [Setup command-line completion](#setup-command-line-completion) |
19 | 20 | - [Upgrade from tfwrapper v7 or older](#upgrade-from-tfwrapper-v7-or-older)
|
20 | 21 | - [Required files](#required-files)
|
21 | 22 | - [Configuration](#configuration)
|
|
38 | 39 | - [Stack path](#stack-path)
|
39 | 40 | - [Development](#development)
|
40 | 41 | - [Tests](#tests)
|
| 42 | + - [Debug command-line completion](#debug-command-line-completion) |
41 | 43 | - [Python code formatting](#python-code-formatting)
|
42 | 44 | - [Checks](#checks)
|
43 | 45 | - [README TOC](#readme-toc)
|
|
57 | 59 | - Azure credentials loading (both Service Principal or User)
|
58 | 60 | - GCP and GKE user ADC support
|
59 | 61 | - Plugins caching
|
| 62 | +- Tab completion |
60 | 63 |
|
61 | 64 | ## Drawbacks
|
62 | 65 |
|
@@ -103,6 +106,18 @@ With zsh, you need to escape brackets:
|
103 | 106 | pipx install 'claranet-tfwrapper[azure]'
|
104 | 107 | ```
|
105 | 108 |
|
| 109 | +## Setup command-line completion |
| 110 | + |
| 111 | +Add the following to your shell's interactive configuration file, e.g. `.bashrc` for bash: |
| 112 | + |
| 113 | +```bash |
| 114 | +eval "$(register-python-argcomplete tfwrapper -e tfwrapper)" |
| 115 | +``` |
| 116 | + |
| 117 | +You can then press the completion key (usually `Tab ↹`) twice to get your partially typed `tfwrapper` commands completed. |
| 118 | + |
| 119 | +Note: the `-e tfwrapper` parameter adds an suffix to the defined `_python_argcomplete` function to avoid clashes with other packages (see https://github.com/kislyuk/argcomplete/issues/310#issuecomment-697168326 for context). |
| 120 | + |
106 | 121 | ## Upgrade from tfwrapper v7 or older
|
107 | 122 |
|
108 | 123 | If you used versions of the wrapper older than v8, there is not much to do when upgrading to v8
|
@@ -623,6 +638,14 @@ All new code contributions should come with unit and/or integrations tests.
|
623 | 638 |
|
624 | 639 | To run those tests locally, use [tox](https://github.com/tox-dev/tox).
|
625 | 640 |
|
| 641 | +## Debug command-line completion |
| 642 | + |
| 643 | +You can get verbose debugging information for `argcomplete` by defining the following environment variable: |
| 644 | + |
| 645 | +```bash |
| 646 | +export _ARC_DEBUG=1 |
| 647 | +``` |
| 648 | + |
626 | 649 | ## Python code formatting
|
627 | 650 |
|
628 | 651 | Our code is formatted with [black](https://github.com/psf/black/).
|
|
0 commit comments