swupd-client icon indicating copy to clipboard operation
swupd-client copied to clipboard

Autogenerate Swupd.bash and swupd.zsh

Open otaviobp opened this issue 5 years ago • 1 comments

Maintaining those two files is a lot of work and we could generate them with the information we have on swupd code base. We have all information we need in "static struct subcmd commands" in main.c and "static const struct option prog_opts" in command files.

otaviobp avatar Aug 14 '19 16:08 otaviobp

Note that the original implementation of swupd.bash was autogenerated, but then we stopped autogenerating it because various commands needed special treatment, like removing the os-core autocompletion for swupd bundle-remove. So as the number of special cases increased, we hit a threshold of complexity for the autogeneration script.

But the swupd CLI has changed a lot in the meantime, gaining new commands and flags, so the added complexity for the special cases may be worth it, from a maintenance perspective.

phmccarty avatar Aug 15 '19 04:08 phmccarty