6 Commits
Author SHA1 Message Date
Icarus Sparry 92a6fcaf76 Make the backward compatability check work
Use the correct variable BASH_VERSINFO, rather than BASH_VERSION

Signed-off-by: Icarus Sparry <icarus.w.sparry@intel.com>
2017-03-27 13:55:52 -07:00
Icarus Sparry cc7544dfb8 Allow for bash versions before 4.4
bash 4.4 added the 'nosort' option for completion. Use this so the
flag options come before the bundle names.

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
Jose R Guzman 3db13fd519 Fix for completion when absolute path is given
Signed-off-by: Jose R Guzman <jose.r.guzman.mosqueda@intel.com>
2016-06-03 16:56:49 -05:00
Jose R Guzman cf9d47383c Adding script to create autocompletion function for complete command.
Signed-off-by: Jose R Guzman <jose.r.guzman.mosqueda@intel.com>
2016-04-12 10:11:16 -07:00