7 Commits
Author SHA1 Message Date
Icarus Sparry bc5cae81dc Update swupd completion code
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>
2018-03-26 11:23:04 -07:00
Icarus Sparry e506b3e0c8 Always generate swupd.bash
Signed-off-by: Icarus Sparry <icarus.w.sparry@intel.com>
2017-03-22 18:32:37 -07:00
Icarus Sparry 611d858797 Reinstate the script which writes the completion function
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>
2017-03-22 18:32:37 -07:00
Icarus Sparry 9a8fd39bee Add package names to completion
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>
2017-03-22 18:32:37 -07:00
Patrick McCarty d167770af6 Refresh completion script
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-06-09 13:36:23 -07:00
Patrick McCarty 362d85d153 Refresh the completion script
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-04-12 12:59:07 -07:00
Patrick McCarty ccf88f5295 Generate initial bash completion script
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-04-12 10:43:58 -07:00