Make swupd save a copy of the current MoM in a readable location, so
the completion code for bundle-add has access to it.
Stop generating the completion code, just use the file directly.
Remove the short option from the completion code, whilst they are
useful for an expert there is little point typing minus tab and then a
letter rather than minus and the letter.
Add crude filename completion for hashdump.
Signed-off-by: Icarus Sparry <icarus.w.sparry@intel.com>
Include feature request from IRC to not offer os-core and
os-core-update bundles as completion targets for bundle-remove.
Signed-off-by: Icarus Sparry <icarus.w.sparry@intel.com>
Remove the script which creates the completion script based on the
output of swupd --help. It wasn't being used (e.g. the completion
didn't have bundle-list in it).
Restructure the completion script to use a case statement to list the
valid completion options. IMHO this makes the code easier to
understand.
Add in package name completion for bundle-add. This requires
/var/lib/swupd/XXXXX/Manifest.MoM to exist (where XXXXX is the
contents of /var/lib/swupd/version), be in the correct format
etc.
Add in package name completion for bundle-remove. This uses the
contents of /usr/share/clear/bundles to get the list of installed
bundles. It would be nice to use $(swupd bundle-list) but it aborts if
it is not being run as root, so this means you can't have completion
for "sudo swupd bundle-remove".
TODO: Fix bundle completion if --path is specified.
Signed-off-by: Icarus Sparry <icarus.w.sparry@intel.com>