{"thread":{"id":"33341","subject":"[PATCH] submodule summary: support --summary-limit=<n>","startedAt":"2013-04-01T13:06:27Z","lastAt":"2013-04-01T13:06:27Z","messageCount":1,"participants":["René Scharfe"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"212794","messageId":"51598653.5030001@lsrfire.ath.cx","threadId":"33341","inReplyTo":null,"subject":"[PATCH] submodule summary: support --summary-limit=<n>","fromName":"René Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2013-04-01T13:06:27Z","receivedAt":"2013-04-01T13:06:27Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"In addition to \"--summary-limit <n>\" support the form \"--summary-limit=<n>\",\nfor consistency with other parameters and commands.\n\nSigned-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>\n---\n git-submodule.sh | 17 +++++++++++------\n 1 file changed, 11 insertions(+), 6 deletions(-)\n\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 204bc78..275c664 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -267,6 +267,11 @@ module_clone()\n \t(clear_local_git_env; cd \"$sm_path\" && GIT_WORK_TREE=. git config core.worktree \"$rel/$b\")\n }\n \n+isnumber()\n+{\n+\tn=$(($1 + 0)) 2>/dev/null && test \"$n\" = \"$1\"\n+}\n+\n #\n # Add a new submodule to the working tree, .gitmodules and the index\n #\n@@ -889,14 +894,14 @@ cmd_summary() {\n \t\t\tfor_status=\"$1\"\n \t\t\t;;\n \t\t-n|--summary-limit)\n-\t\t\tif summary_limit=$(($2 + 0)) 2>/dev/null && test \"$summary_limit\" = \"$2\"\n-\t\t\tthen\n-\t\t\t\t:\n-\t\t\telse\n-\t\t\t\tusage\n-\t\t\tfi\n+\t\t\tsummary_limit=\"$2\"\n+\t\t\tisnumber \"$summary_limit\" || usage\n \t\t\tshift\n \t\t\t;;\n+\t\t--summary-limit=*)\n+\t\t\tsummary_limit=\"${1#--summary-limit=}\"\n+\t\t\tisnumber \"$summary_limit\" || usage\n+\t\t\t;;\n \t\t--)\n \t\t\tshift\n \t\t\tbreak\n-- \n1.8.2\n"}]}