iterative / shtab

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

Could replace more non-word characters #165

Closed dustinlagoy closed 5 months ago

dustinlagoy commented 6 months ago

I have an argparse script which accepts subcommands with names like:

my/first/subcommand
my/second/subcommand

which end up causing invalid completion scripts similar to #20.

It would be trivial to add / to the list of characters replaced in wordify(), or even change the character set to \W to replace any non-word character. Are either of these options preferable? (both work when tested with my script)

I'm happy to put together a one-line pull request if you think this is worthwhile.

casperdcl commented 6 months ago

Sure, please do open a PR :)