[pkg-cryptsetup-devel] Bug#700777: Add Bash completion for /etc/crypttab targets to cryptdisks_{start, stop}

Claudius Hubig debian_1302 at chubig.net
Sun Feb 17 13:15:11 UTC 2013


Package: cryptsetup
Version: 2:1.4.3-4
Severity: wishlist

Dear Maintainer(s),

it would be nice if cryptsetup shipped a Bash completion snippet for
cryptdisks_{start,stop} to allow for easy autocompletion of possibly
long (or rarely used) names in /etc/crypttab.

The following, placed in /etc/bash_completion.d/cryptdisks, works for
me, but I am sure there are ways one can improve it. :-)

-- /etc/bash_completion.d/cryptdisks
# cryptdisks_{start,stop} completion by first row of crypttab
#
# Copyright 2013 Claudius Hubig <cl_crds at chubig.net>, 2-clause BSD

_cryptdisks() {
    local tf;
    tf=${TABFILE-"/etc/crypttab"};
    COMPREPLY=($(egrep -v "^[[:space:]]*(#|$)" "${tf}" | egrep -o "^${COMP_WORDS[COMP_CWORD]}[^[:space:]]*"));
    return 0;
}

complete -F _cryptdisks cryptdisks_start;
complete -F _cryptdisks cryptdisks_stop;
------------------------------------

Thank you very much for considering this and your work for Debian,

Claudius

-- Package-specific info:
-- System Information:
Debian Release: 7.0
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'stable-updates'), (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.7.1.a2017.3 (SMP w/4 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages cryptsetup depends on:
ii  cryptsetup-bin         2:1.4.3-4
ii  debconf [debconf-2.0]  1.5.49
ii  dmsetup                2:1.02.74-4
ii  libc6                  2.13-37

Versions of packages cryptsetup recommends:
ii  busybox                                 1:1.20.0-7
ii  console-setup                           1.88
ii  initramfs-tools [linux-initramfs-tool]  0.109
ii  kbd                                     1.15.3-9

Versions of packages cryptsetup suggests:
ii  dosfstools              3.0.13-1
ii  liblocale-gettext-perl  1.05-7+b1

-- debconf information:
  cryptsetup/prerm_active_mappings: true



More information about the pkg-cryptsetup-devel mailing list