-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Description
Even with AI help, it is somehow painful to write completion code, e.g. for CLI option values - especially if their spec/type is non-trivial.
Guess shtab's audience is primarily python CLI tool developers who just want to have shell completions, but are not used to or do not like to write shell completion scripts (or preambles with support functions) on their own for N different shells they want to support.
I just had the idea that it might be nice to move that logic to python code (it then would also be independent of the shell), e.g.:
- we want to complete
borg create --compression=X, that option has a type ofCompressionSpec - some shtab-generated preamble code could call back like
borg completion --type=CompressionSpec --value=X - the python code in borg would then compute a list of valid completions (starting from X) and output them on stdout
- the preamble code would use that / present it to the user
Metadata
Metadata
Assignees
Labels
No labels