[QUESTION] Is possible to programatically install autocompletion? #1578
Replies: 3 comments
-
|
if you want to avoid having the import typer
app = typer.Typer(add_completion=False)That being said, I don't know if there is a clean way to run a "post-install" hook when using #!/usr/bin/env bash
set -euo pipefail
pip install my_app
my_app --show-completion > /where/this/should/be/placed |
Beta Was this translation helpful? Give feedback.
-
|
I just want to emphasise that I agree with the proposed "just-works" behaviour would a very good selling-point of Typer. If you endup having to write documentation on how to enable completion for various shells, you already failed a little bit on UX side. I think that an ideal app should prompt for optional installation of auto-completion hooks the first time is called. That approach should be seen as a decent trade-off. |
Beta Was this translation helpful? Give feedback.
-
|
I think I'm in the same boat here. I actually just want a way to initiate |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
First check
Description
Is it possible / would it be possible to programatically install completions (for example during pip install ) in order to exclude --install-completion / --show-completion from CLI options?
Additional context
The use case is the following: an app delivered to a customer as much auto-configured as possible, since its technical knowledge / ability is limited and the motto for me here is providing software as simple as possible, therefore keeping only bare minimum configuration options without losing functionality.
Scenario:
cmd / bash shells (Win10 and Ubuntu 20.04).
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions