瀏覽代碼

Also suggest short options

Alois Mahdal 7 年之前
父節點
當前提交
69d96ade04
共有 1 個檔案被更改,包括 7 行新增1 行删除
  1. 7
    1
      src/complete.bash

+ 7
- 1
src/complete.bash 查看文件

@@ -1,12 +1,18 @@
1 1
 #!/bin/bash
2 2
 
3 3
 __satcmd() {
4
-    local cur opts
4
+    local cur opts sopts
5 5
     COMPREPLY=()
6 6
     cur="${COMP_WORDS[COMP_CWORD]}"
7
+    sopts="-d -h -v"
7 8
     opts="--help --verbose --debug --version --version-semver"
8 9
 
9 10
     case "$cur" in
11
+        -*)
12
+            COMPREPLY=(
13
+                $(compgen -W "$sopts $opts" -- "${cur}")
14
+            )
15
+            ;;
10 16
         --*)
11 17
             COMPREPLY=(
12 18
                 $(compgen -W "$opts" -- "${cur}")