Browse Source

Satisfy ShellCheck recommendations

Alois Mahdal 8 years ago
parent
commit
1fdb9cfeef
2 changed files with 16 additions and 13 deletions
  1. 12
    9
      src/bin/app.skel
  2. 4
    4
      src/complete.bash

+ 12
- 9
src/bin/app.skel View File

9
 # =====BEGIN BUILT PART=====
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
 shellfu import saturnin
25
 shellfu import saturnin
23
 
26
 

+ 4
- 4
src/complete.bash View File

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