Skip to content

Commit

Permalink
nativeオプションを追加 (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
hayatehay committed Nov 12, 2023
1 parent ff9581d commit 3c233e8
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions src/nako
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
set -eu

# Default Settings
nako_version="0.9"
nako_version="0.9.1"
nako_name="Nako"
nako_cmd="nako"
nako_path="$(dirname $(realpath ${0}))/$(basename ${0})"
Expand Down Expand Up @@ -1114,7 +1114,7 @@ run_operation() {

# Parse options
OPTS=("A" "D" "F" "N" "Q" "R" "S" "T" "U" "G" "h" "V" "P" "d" "b:" "a" "y" "e" "s" "u" "i" "c" "q" "n" "k" "r:" "l" "t" "w" "p" "q" "m" "g")
OPTL=("query" "remove" "sync" "help" "version" "debug" "nako" "show" "dbpath:" "getpkgbuild" "explicit" "aururl" "aur" "noconfirm" "info" "config:" "groups" "makepkg:" "mflags:" "pacman:" "git:" "gitflags:" "gpg:" "gpgflags:" "makepkgconf:" "nomakepkgconf" "nodeps" "deps" "list" "refresh" "print" "file" "bash-debug" "msg-debug" "search" "sysupgrade" "color:" "nocolor" "clean" "quiet" "arch:" "confirm" "disable-download-timeout" "curl:" "curlflags:" "unneeded" "puella" "nako-debug" "cascade" "ignoregroup:" "ignore:" "hookdir:" "gpgdir:" "cachedir:" "check" "root:" "asdeps" "asexplicit" "needed" "unrequired" "downloadonly" "foreign" "quiet" "stats")
OPTL=("query" "remove" "sync" "help" "version" "debug" "nako" "show" "dbpath:" "getpkgbuild" "explicit" "aururl" "aur" "noconfirm" "info" "config:" "groups" "makepkg:" "mflags:" "pacman:" "git:" "gitflags:" "gpg:" "gpgflags:" "makepkgconf:" "nomakepkgconf" "nodeps" "deps" "list" "refresh" "print" "file" "bash-debug" "msg-debug" "search" "sysupgrade" "color:" "nocolor" "clean" "quiet" "arch:" "confirm" "disable-download-timeout" "curl:" "curlflags:" "unneeded" "native" "puella" "nako-debug" "cascade" "ignoregroup:" "ignore:" "hookdir:" "gpgdir:" "cachedir:" "check" "root:" "asdeps" "asexplicit" "needed" "unrequired" "downloadonly" "foreign" "quiet" "stats")
GETOPT=(-o "$(printf "%s," "${OPTS[@]}")" -l "$(printf "%s," "${OPTL[@]}")" -- "${@}")
readarray -t PARSED_ARGS < <(getopt "${GETOPT[@]}")
RAW_ARGS=("${@}")
Expand Down Expand Up @@ -1222,10 +1222,6 @@ if [[ "${pass_to_pacman}" = false ]]; then
option_y_count=$(( option_y_count + 1 ))
shift 1
;;
-n | --nosave)
add_args pacman "--nosave"
shift 1
;;
-r | --root)
add_args pacman "--root" "${2}"
shift 1
Expand Down Expand Up @@ -1372,6 +1368,10 @@ if [[ "${pass_to_pacman}" = false ]]; then
msgdebug=true
shift 1
;;
--native)
add_args pacman "--native"
shift 1
;;
--noconfirm)
add_args pacman "--noconfirm"
noconfirm=true
Expand All @@ -1387,6 +1387,10 @@ if [[ "${pass_to_pacman}" = false ]]; then
nodeps=true
shift 1
;;
--nosave)
add_args pacman "--nosave"
shift 1
;;
--needed)
add_args pacman "--needed"
needed=true
Expand Down Expand Up @@ -1538,6 +1542,20 @@ if [[ "${pass_to_pacman}" = false ]]; then
esac
shift 1
;;
-n)
case "${operation}" in
"query")
add_args pacman "--native"
;;
"remove")
add_args pacman "--nosave"
;;
*)
unavailable_in_this_operation
;;
esac
shift 1
;;
-p)
case "${operation}" in
"query")
Expand Down

0 comments on commit 3c233e8

Please sign in to comment.