瀏覽代碼

Satisfy ShellCheck recommendations

Alois Mahdal 8 年之前
父節點
當前提交
1fdb9cfeef
共有 2 個檔案被更改,包括 16 行新增13 行删除
  1. 12
    9
      src/bin/app.skel
  2. 4
    4
      src/complete.bash

+ 12
- 9
src/bin/app.skel 查看文件

@@ -9,15 +9,18 @@ shellfu import pretty
9 9
 # =====BEGIN BUILT PART=====
10 10
 #
11 11
 
12
-SATURNIN_APP_CODENAME="__MKIT_PROJ_CODENAME__"
13
-SATURNIN_APP_TAGLINE="__MKIT_PROJ_TAGLINE__"
14
-SATURNIN_APP_VERSION="__MKIT_PROJ_VERSION__"
15
-SATURNIN_APP_GIT_HASH="__MKIT_PROJ_GIT_LASTHASH__"
16
-SATURNIN_CACHE_HOME="__SATURNIN_CACHE_HOME__"
17
-SATURNIN_LIBEXEC="__SATURNIN_LIBEXEC__"
18
-SATURNIN_LIBEXEC_PREFIX="__MKIT_PROJ_PKGNAME__-"
19
-SHELLFU_PATH="__SATURNIN_SHELLFU_DIR__"
20
-PRETTY_USAGE="subcommand"
12
+#shellcheck disable=SC2034
13
+{
14
+    SATURNIN_APP_CODENAME="__MKIT_PROJ_CODENAME__"
15
+    SATURNIN_APP_TAGLINE="__MKIT_PROJ_TAGLINE__"
16
+    SATURNIN_APP_VERSION="__MKIT_PROJ_VERSION__"
17
+    SATURNIN_APP_GIT_HASH="__MKIT_PROJ_GIT_LASTHASH__"
18
+    SATURNIN_CACHE_HOME="__SATURNIN_CACHE_HOME__"
19
+    SATURNIN_LIBEXEC="__SATURNIN_LIBEXEC__"
20
+    SATURNIN_LIBEXEC_PREFIX="__MKIT_PROJ_PKGNAME__-"
21
+    SHELLFU_PATH="__SATURNIN_SHELLFU_DIR__"
22
+    PRETTY_USAGE="subcommand"
23
+}
21 24
 
22 25
 shellfu import saturnin
23 26
 

+ 4
- 4
src/complete.bash 查看文件

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