Browse Source

Use non-specific global names where possible

Use of app name when naming of global variables and/or mkit tokens makes
upgrade of the saturnin template painful and error-prone, while none of
these variables can be overriden from environment so the namespacing
advantage is vain.
Alois Mahdal 8 years ago
parent
commit
ac6b62e952
2 changed files with 17 additions and 17 deletions
  1. 6
    6
      mkit.ini
  2. 11
    11
      src/bin/satcmd.skel

+ 6
- 6
mkit.ini View File

37
     etc_bc  = /etc/bash_completion.d
37
     etc_bc  = /etc/bash_completion.d
38
 
38
 
39
 [vars]
39
 [vars]
40
-    __SATCMD_CACHE_HOME__       = $HOME/.local/share/satcmd
41
-    __SATCMD_CONFIG_USER__      = $HOME/.satcmd
42
-    __SATCMD_CONFIG_LOCAL__     = [roots:etc]
43
-    __SATCMD_LIBEXEC__          = [roots:libexec]
44
-    __SATCMD_SHARE__            = [roots:share]
45
-    __SATCMD_SHELLFU_DIR__      = [roots:share]/shellfu
40
+    __SATURNIN_CACHE_HOME__     = $HOME/.local/share/satcmd
41
+    __SATURNIN_CONFIG_USER__    = $HOME/.satcmd
42
+    __SATURNIN_CONFIG_LOCAL__   = [roots:etc]
43
+    __SATURNIN_LIBEXEC__        = [roots:libexec]
44
+    __SATURNIN_SHARE__          = [roots:share]
45
+    __SATURNIN_SHELLFU_DIR__    = [roots:share]/shellfu
46
 
46
 
47
 [files:bin]
47
 [files:bin]
48
     src/bin/satcmd              = satcmd
48
     src/bin/satcmd              = satcmd

+ 11
- 11
src/bin/satcmd.skel View File

12
 
12
 
13
 SHELLFU_INIGREP_PATH="$(
13
 SHELLFU_INIGREP_PATH="$(
14
     inigrep__mkpath \
14
     inigrep__mkpath \
15
-        __SATCMD_CONFIG_USER__/ini.d \
16
-        __SATCMD_CONFIG_USER__ \
17
-        __SATCMD_CONFIG_LOCAL__ \
18
-        __SATCMD_SHARE__/ini.d
15
+        __SATURNIN_CONFIG_USER__/ini.d \
16
+        __SATURNIN_CONFIG_USER__ \
17
+        __SATURNIN_CONFIG_LOCAL__ \
18
+        __SATURNIN_SHARE__/ini.d
19
 )"
19
 )"
20
 
20
 
21
-SHELLFU_PATH="__SATCMD_SHELLFU_DIR__"
21
+SHELLFU_PATH="__SATURNIN_SHELLFU_DIR__"
22
 SHELLFU_PRETTY_USAGE="subcommand"
22
 SHELLFU_PRETTY_USAGE="subcommand"
23
-SATCMD_CACHE_HOME="__SATCMD_CACHE_HOME__"
24
-SATURNIN_LIBEXEC="__SATCMD_LIBEXEC__"
23
+SATURNIN_CACHE_HOME="__SATURNIN_CACHE_HOME__"
24
+SATURNIN_LIBEXEC="__SATURNIN_LIBEXEC__"
25
 SATURNIN_LIBEXEC_PREFIX="satcmd-"
25
 SATURNIN_LIBEXEC_PREFIX="satcmd-"
26
-SATCMD_VERSION="__VERSION__"
26
+SATURNIN_APP_VERSION="__VERSION__"
27
 
27
 
28
 #
28
 #
29
 # =====END BUILT PART=====
29
 # =====END BUILT PART=====
32
 shellfu import saturnin
32
 shellfu import saturnin
33
 
33
 
34
 export SHELLFU_INIGREP_PATH SHELLFU_PATH SHELLFU_PRETTY_USAGE \
34
 export SHELLFU_INIGREP_PATH SHELLFU_PATH SHELLFU_PRETTY_USAGE \
35
-       SATCMD_VERSION SATCMD_CACHE_HOME
35
+       SATURNIN_APP_VERSION SATURNIN_CACHE_HOME
36
 
36
 
37
 usage() {
37
 usage() {
38
     mkusage "[-d|-v] command [args...]" \
38
     mkusage "[-d|-v] command [args...]" \
41
 }
41
 }
42
 
42
 
43
 version_info() {
43
 version_info() {
44
-    echo "$(basename "$0") (Spirit of your toolbox) $SATCMD_VERSION"
44
+    echo "$(basename "$0") (Spirit of your toolbox) $SATURNIN_APP_VERSION"
45
     exit "$SHELLFU_EXIT_OK"
45
     exit "$SHELLFU_EXIT_OK"
46
 }
46
 }
47
 
47
 
49
     -d|--debug)     export SHELLFU_DEBUG=true; shift   ;;
49
     -d|--debug)     export SHELLFU_DEBUG=true; shift   ;;
50
     -v|--verbose)   export SHELLFU_VERBOSE=true; shift ;;
50
     -v|--verbose)   export SHELLFU_VERBOSE=true; shift ;;
51
     --version)      version_info                    ;;
51
     --version)      version_info                    ;;
52
-    --version-semver) echo "$SATCMD_VERSION"; exit ;;
52
+    --version-semver) echo "$SATURNIN_APP_VERSION"; exit ;;
53
     -*)             usage;                          ;;
53
     -*)             usage;                          ;;
54
     --*)            usage;                          ;;
54
     --*)            usage;                          ;;
55
     --)             shift; break                    ;;
55
     --)             shift; break                    ;;