davidovich / summon

Summon: your data on caffeine
Apache License 2.0
12 stars 0 forks source link

feature: complex command and subcommand descriptions and completions. #77

Closed davidovich closed 2 years ago

davidovich commented 2 years ago

This has been cooking for a long time.

This long commit series introduces a way to describe complex sub-commands to taylor declarative command line interfaces to a proxied command. Not very useful when targeting an installed command, but very powerful when targeting docker containers.

It essentially allows tailoring a command-line to a container, which is typically hard to invoke (volume mounts, environment settings, image repository name, etc). Supports help, completions and flags.

This change also leverages cobra's dynamic completions. This allows delegating completion to a program inside the container. I use it to give a better cli to a makefile program (a series of utility makefile targets) which typically has poor user oriented command line UX.

closes #67