All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] submodule summary: support --summary-limit=<n>
@ 2013-04-01 13:06 René Scharfe
  0 siblings, 0 replies; only message in thread
From: René Scharfe @ 2013-04-01 13:06 UTC (permalink / raw)
  To: git discussion list; +Cc: Jens Lehmann, Junio C Hamano, Ping Yin

In addition to "--summary-limit <n>" support the form "--summary-limit=<n>",
for consistency with other parameters and commands.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
---
 git-submodule.sh | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/git-submodule.sh b/git-submodule.sh
index 204bc78..275c664 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -267,6 +267,11 @@ module_clone()
 	(clear_local_git_env; cd "$sm_path" && GIT_WORK_TREE=. git config core.worktree "$rel/$b")
 }
 
+isnumber()
+{
+	n=$(($1 + 0)) 2>/dev/null && test "$n" = "$1"
+}
+
 #
 # Add a new submodule to the working tree, .gitmodules and the index
 #
@@ -889,14 +894,14 @@ cmd_summary() {
 			for_status="$1"
 			;;
 		-n|--summary-limit)
-			if summary_limit=$(($2 + 0)) 2>/dev/null && test "$summary_limit" = "$2"
-			then
-				:
-			else
-				usage
-			fi
+			summary_limit="$2"
+			isnumber "$summary_limit" || usage
 			shift
 			;;
+		--summary-limit=*)
+			summary_limit="${1#--summary-limit=}"
+			isnumber "$summary_limit" || usage
+			;;
 		--)
 			shift
 			break
-- 
1.8.2

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-04-01 13:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-01 13:06 [PATCH] submodule summary: support --summary-limit=<n> René Scharfe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.