iterative / shtab

↔️ Automagic shell tab completion for Python CLI applications
https://docs.iterative.ai/shtab
Other
362 stars 35 forks source link

[feature] get completion script from python #126

Closed Freed-Wu closed 1 year ago

Freed-Wu commented 1 year ago

If we want get shell completion scripts from python, we must complete(parser, xxsh, PREAMBLE). However, we can get completion script from shell by XXX --print-completion xxsh, don't need PREAMBLE. Why not ignore PREAMBLE, too?

casperdcl commented 1 year ago

Preambles can only be defined in the Python API (shtab.complete(preamble) and shtab.add_argument_to(preamble)].

It seems clunky to support CLI preambles as well.