bash-completion icon indicating copy to clipboard operation
bash-completion copied to clipboard

[cryptsetup] luksErase is not completed

Open ghost opened this issue 2 years ago • 1 comments

Describe the bug

When I press the tab key in cryptsetup luks, luksErase is not completed.

To reproduce

  1. Type cryptsetup luksE

Expected behavior

luksErase appears as a candidate for completion.

Versions (please complete the following information)

  • [x] Operating system name/distribution and version: Arch Linux
  • [x] bash version, echo "$BASH_VERSION": 5.1.16(1)-release
  • [x] bash-completion version, (IFS=.; echo "${BASH_COMPLETION_VERSINFO[*]}"): 2.11

Additional context

Debug trace

ghost avatar Jun 14 '22 08:06 ghost

This is because just the list hardcoded in completions/cryptsetup is not up to date:

https://github.com/scop/bash-completion/blob/9cde158077ba70edecf2898696692a52d844d858/completions/cryptsetup#L43-L46

The upstream option parser is found here:

https://gitlab.com/cryptsetup/cryptsetup/-/blob/main/src/cryptsetup.c#L3155-3208 https://gitlab.com/cryptsetup/cryptsetup/-/blob/main/src/cryptsetup.c#L2831-2867 https://gitlab.com/cryptsetup/cryptsetup/-/blob/main/src/cryptsetup_args.h#L28-53

The differences are

--- a.txt^I2022-06-14 17:51:57.795545785 +0900
+++ b.txt^I2022-06-14 17:52:12.900602154 +0900
@@ -1,20 +1,41 @@
 benchmark
+bitlkClose
+bitlkDump
+bitlkOpen
 close
+config
+convert
+create
 erase
 isLuks
+loopaesClose
+loopaesOpen
 luksAddKey
 luksChangeKey
+luksClose
+luksConfig
+luksConvertKey
 luksDump
+luksErase
 luksFormat
 luksHeaderBackup
 luksHeaderRestore
 luksKillSlot
+luksOpen
 luksRemoveKey
 luksResume
 luksSuspend
 luksUUID
 open
+plainClose
+plainOpen
+reencrypt
+refresh
+remove
 repair
 resize
 status
+tcryptClose
 tcryptDump
+tcryptOpen
+token

akinomyoga avatar Jun 14 '22 08:06 akinomyoga