]> git.corax.cc Git - toolbox/commitdiff
include/opt: Remove unused variable __opt_num
authorMatthias Kruk <m@m10k.eu>
Thu, 11 Aug 2022 16:38:04 +0000 (01:38 +0900)
committerMatthias Kruk <m@m10k.eu>
Thu, 11 Aug 2022 16:41:03 +0000 (01:41 +0900)
The opt module counts the number of options that were defined, but
the count is never used.

This commit removes the unused variable.

include/opt.sh

index e50857543cd5bedefa626a175693ba937f8506a5..0cddf5e759832835058b75816794e939c23dcacb 100644 (file)
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 # opt.sh - Toolbox commandline parser module
-# Copyright (C) 2021 Matthias Kruk
+# Copyright (C) 2021-2022 Matthias Kruk
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -33,7 +33,6 @@ __init() {
        declare -Axg __opt_regex
        declare -Axg __opt_action
        declare -Axg __opt_map
-       declare -xgi __opt_num=0
 
        opt_add_arg "h" "help" "" 0 \
                    "Print this text" \
@@ -116,8 +115,6 @@ opt_add_arg() {
                __opt_default["$long"]="$default"
        fi
 
-       ((__opt_num++))
-
        return 0
 }