Просмотр исходного кода

Add variable docstrings where missing

Alois Mahdal 7 лет назад
Родитель
Сommit
cb36dd3d7c
1 измененных файлов: 7 добавлений и 7 удалений
  1. 7
    7
      src/saturnin.sh.skel

+ 7
- 7
src/saturnin.sh.skel Просмотреть файл

@@ -80,7 +80,7 @@ saturnin__bug() {
80 80
     # In such cases, it makes sense to print also version information to
81 81
     # help users with reporting.
82 82
     #
83
-    local msg
83
+    local msg           # message core
84 84
     for msg in "$@";
85 85
     do
86 86
         warn "bug: $msg"
@@ -212,7 +212,7 @@ saturnin__get() {
212 212
     # This is aimed to help debugging and testing the app (or Saturnin
213 213
     # itself) by showing packaging and deployment related info.
214 214
     #
215
-    local key=${1#--saturnin-get-}
215
+    local key=${1#--saturnin-get-}      # internal info key
216 216
     case "$key" in
217 217
         saturnin-conf-path) echo "$SATURNIN_CONF_PATH"      ;;
218 218
         app-git-hash)   echo "$SATURNIN_APP_GIT_HASH"       ;;
@@ -246,7 +246,7 @@ saturnin__main() {
246 246
     # After setting all mandatory environment variables, call this from your
247 247
     # main meta-command script.
248 248
     #
249
-    local subcommand
249
+    local subcommand    # subcommand to execute (first non-option)
250 250
     test -n "$SATURNIN_CACHE_HOME"     || die "SATURNIN_CACHE_HOME is not set"
251 251
     test -n "$SATURNIN_LIBEXEC"        || die "SATURNIN_LIBEXEC is not set"
252 252
     test -n "$SATURNIN_LIBEXEC_PREFIX" || die "SATURNIN_LIBEXEC_PREFIX is not set"
@@ -310,8 +310,8 @@ saturnin__runhook() {
310 310
     # unless syntax check fails, execute it as Bash code (in separate
311 311
     # process).
312 312
     #
313
-    local hname="$1"
314
-    local hook_code
313
+    local hname="$1"    # hook name
314
+    local hook_code     # ... code
315 315
     test -n "$SATURNIN_SUBCOMMAND" || {
316 316
         warn "unknown subcommand, ignoring hook: $hname"
317 317
         return 0
@@ -377,7 +377,7 @@ saturnin__wraphook() {
377 377
     # status of the payload command, even if hooks fail.  Ignore post-hook
378 378
     # if payload command failed.
379 379
     #
380
-    local es=0
380
+    local es=0      # exit status of thid function
381 381
     saturnin__runhook pre
382 382
     "$@" || return $?
383 383
     es=$?
@@ -486,7 +486,7 @@ _saturnin__nl2colon() {
486 486
     # drop them and also get the colons right.
487 487
     #
488 488
     local idx=0     # current item index (zero-based)
489
-    local path
489
+    local path      # each path on stdin
490 490
     while read -r path;
491 491
     do
492 492
         test -z "$path" && continue