[Bash-completion-devel] New improved cryptsetup completion

Bruno Ricci bruno.ricci at epfl.ch
Fri Feb 7 14:48:58 UTC 2014


Okay I compared the help pages of cryptsetup --help for each version
from 1.3.0 (release 2011-04-05) to 1.6.3 (latest). I also looked at the
release notes corresponding to theses versions. The result is that now
the cryptsetup completion I have takes into account options and command
introduced between 1.3.0 and 1.6.3 . (if I didn't miss some)
Moreover now only appropriate (block devices and directories) are
suggested when a device is expected since cryptsetup acts on block
devices. This clean up significantly the suggested option because
/dev/is full of irrelevant stuff for cryptsetup (eg tty*, vcs*, etc)

It works fine on my computer and a few different version of cryptsetup
but comments are welcome.

Attached is the patch with respect to the git tree and the whole
cryptsetup completion.

On 02/05/2014 04:09 PM, Bruno Ricci wrote:
> I have been working on the cryptsetup completion. The one currently in
> the tree is missing some option (ex tcryptOpen, tcryptDump, etc), has
> some obsolete options (for example luksDelKey is now obselete as of
> cryptsetup 1.6.2). Moreover the current completion is in general not
> clever enough. For example --use-random and --use-urandom are mutually
> exclusive and so if --use-random is on the command line, --use-urandom
> should not be suggested. As a downside, the completion is now approx 40k
> in size.
> 
> Features of the new completion.
> 	-- all command in the man page (except create)
>  	(as of cryptsetup 1.6.2) are now completed with
> 	the appropriate options. Ex. luksKillSlot <tab> <tab>
> 	 does only show the options and parameter
> 	which are valid with this command.
> 	-- mutually exclusive command are implemented
> 	Ex. --use-urandom | --use-random, --hash | --cipher
> 	for the benchmark command
> 	-- the majority of options only make sense specified once
> 	(exception are --key-file with tcrypt* and some few other)
> 	so options already specified on the command line are not
> 	suggested again (except for the few exceptions).
> 	-- the file is now documented
> 	-- I believe it complies with the style guideline
> 	(in particular the 79 char limit and the "tab-are-4-space")
> 
> The patch and the whole file are attached. What do you think about it ?
> In particular how do we deal with users who have
> an older version of cryptsetup which might not have all the commands
> in this completion (in particular tcrypt* which was introduced in 1.6.0)
> Comments, suggestions and criticism are welcome.
> 
> Bruno Ricci
> 







-------------- next part --------------
A non-text attachment was scrubbed...
Name: cryptsetup.tar.bz2
Type: application/x-bzip2
Size: 5684 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/bash-completion-devel/attachments/20140207/569b4166/attachment.bin>


More information about the Bash-completion-devel mailing list