OSDN Git Service

[update] : Added wfa help
authorhayao <shun819.mail@gmail.com>
Sun, 20 Dec 2020 00:03:59 +0000 (09:03 +0900)
committerhayao <shun819.mail@gmail.com>
Sun, 20 Dec 2020 00:03:59 +0000 (09:03 +0900)
wfa

diff --git a/wfa b/wfa
index 08887e1..e1d4c00 100755 (executable)
--- a/wfa
+++ b/wfa
@@ -348,6 +348,8 @@ remove() {
 }
 
 usage (){
+    local _pacman_help=false
+
     local _wfa_usage
     _wfa_usage() {
         echo "Usage:"
@@ -366,10 +368,24 @@ usage (){
         #echo "wfa {-U --upgrade}     [options] <file(s)>"
     }
 
+    local _wfa_usage_sync
+    _wfa_usage_sync() {
+        echo "usage:  wfa {-S --sync} [options] [package(s)]"
+        echo "options:"
+        echo "  -b, --dbpath <path>  set an alternate database location"
+        echo "      --config <path>  set an alternate configuration file"
+        echo "      --noconfirm      do not ask for any confirmation"
+
+    }
+
     if [[ "${operation}" = "none" ]]; then
         _wfa_usage
-    else
+    elif [[ "${_pacman_help}" = true ]]; then
         pacman -h --${operation}
+    elif [[ "$(type -t "_wfa_usage_${operation}" )" = "function" ]]; then
+        _wfa_usage_${operation}
+    else
+        msg_error "Undefined operation." 1
     fi
 }