Skip to content

Commit

Permalink
fix(core): reintroduce shell completion command (#2562)
Browse files Browse the repository at this point in the history
* introduce renku env command
* reintroduce shell completion command 
* use shellingham for shell detection
  • Loading branch information
vigsterkr committed Jan 24, 2022
1 parent c4fd71c commit 6b3ee60
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 3 deletions.
10 changes: 9 additions & 1 deletion docs/how-to-guides/shell-integration.rst
Expand Up @@ -5,6 +5,14 @@ Shell integration of Renku CLI

Renku CLI supports shell auto-completion for Renku commands and their arguments like datasets and workflows.

A convenience method is available for printing to the standard output the shell completion command for the
currently used shell:

.. code-block:: console
$ renku env --shell-completion
_RENKU_COMPLETE=zsh_source renku
To activate tab completion for your supported shell run the following command after installing Renku CLI:

.. tabs::
Expand Down Expand Up @@ -37,7 +45,7 @@ in case of ``renku workflow execute`` the available ``Plans`` are going to be li
.. note::

Tab completion of available ``Plans`` only works if the user is executing the command
Tab completion of available ``Plans`` (or ``Datasets``) only works if the user is executing the command
within a Renku project.


Expand Down
54 changes: 53 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Expand Up @@ -129,6 +129,7 @@ rich = "<10.13.0,>=9.3.0"
rq = { version = "==1.10.0", optional = true }
rq-scheduler = { version = "==0.11.0", optional = true }
sentry-sdk = { version = "<1.4.4,>=0.7.4", extras = ["flask"], optional = true }
shellingham = "1.4.0"
sphinxcontrib-spelling = { version = "7.*", optional = true }
sphinx-rtd-theme = { version = "<1.1,>=0.5.0", optional = true }
sphinx-tabs = { version = "==3.2.0", optional = true }
Expand Down
4 changes: 3 additions & 1 deletion renku/cli/__init__.py
Expand Up @@ -73,6 +73,7 @@
from renku.cli.config import config
from renku.cli.dataset import dataset
from renku.cli.doctor import doctor
from renku.cli.env import env
from renku.cli.exception_handler import IssueFromTraceback
from renku.cli.githooks import githooks as githooks_command
from renku.cli.graph import graph
Expand Down Expand Up @@ -115,7 +116,7 @@ def get_entry_points(name: str):
return all_entry_points.get(name, [])


WARNING_UNPROTECTED_COMMANDS = ["clone", "init", "help", "login", "logout", "service", "credentials"]
WARNING_UNPROTECTED_COMMANDS = ["clone", "init", "help", "login", "logout", "service", "credentials", "env"]


def _uuid_representer(dumper, data):
Expand Down Expand Up @@ -209,6 +210,7 @@ def help(ctx):
cli.add_command(config)
cli.add_command(dataset)
cli.add_command(doctor)
cli.add_command(env)
cli.add_command(githooks_command)
cli.add_command(graph)
cli.add_command(init_command)
Expand Down

0 comments on commit 6b3ee60

Please sign in to comment.