From 382337e9970c3e522461deadb99a88e9ac307215 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sun, 12 Mar 2017 15:24:58 -0400 Subject: fix argc value in __require_argc I'm too stubborn to turn extdebug on, so let's just give up on BASH_ARGC (which never worked properly because former stubbornness about extdebug), and just pass $#. --- asp.in | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/asp.in b/asp.in index 15b2387..d22f81e 100644 --- a/asp.in +++ b/asp.in @@ -44,7 +44,7 @@ EOF } __require_argc() { - local min max argc=$(( BASH_ARGC - 1 )) + local min max argc=$2 case $1 in *-*) @@ -197,72 +197,72 @@ disk_usage() { } action__checkout() { - __require_argc 1- + __require_argc 1- $# map package_checkout "$@" } action__difflog() { - __require_argc 1 + __require_argc 1 $# difflog "$1" } action__disk-usage() { - __require_argc 0 + __require_argc 0 $# disk_usage } action__export() { - __require_argc 1- + __require_argc 1- $# map package_export "$@" } action__gc() { - __require_argc 0 + __require_argc 0 $# gc } action__help() { - __require_argc 0 + __require_argc 0 $# usage } action__list-all() { - __require_argc 0 + __require_argc 0 $# list_all } action__list-arches() { - __require_argc 1- + __require_argc 1- $# map package_get_arches "$@" } action__list-local() { - __require_argc 0 + __require_argc 0 $# list_local } action__list-repos() { - __require_argc 1- + __require_argc 1- $# map package_get_repos "$@" } action__log() { - __require_argc 1 + __require_argc 1 $# log "$1" } action__shortlog() { - __require_argc 1 + __require_argc 1 $# shortlog "$1" } action__show() { - __require_argc 1-2 + __require_argc 1-2 $# package_show_file "$@" } action__untrack() { - __require_argc 1- + __require_argc 1- $# map untrack "$@" } @@ -271,7 +271,7 @@ action__update() { } action__ls-files() { - __require_argc 1 + __require_argc 1 $# package_list_files "$1" } -- cgit v1.2.3-70-g09d2