public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [maintainer-tools PATCH 1/6] dim: refer to the script itself by basename without path
@ 2016-10-11  8:47 Jani Nikula
  2016-10-11  8:47 ` [maintainer-tools PATCH 2/6] dim: columnize usage output if column(1) is available Jani Nikula
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Jani Nikula @ 2016-10-11  8:47 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

Add $dim for the basename of the script and use it.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 dim | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/dim b/dim
index 126d79aea624..5b105743cd65 100755
--- a/dim
+++ b/dim
@@ -87,6 +87,8 @@ DIM_TEMPLATE_SIGNATURE=${DIM_TEMPLATE_SIGNATURE:-$HOME/.dim.template.signature}
 # Internal configuration.
 #
 
+dim=$(basename $0)
+
 today=`date +%Y-%m-%d`
 
 drm_intel_ssh=ssh://git.freedesktop.org/git/drm-intel
@@ -140,7 +142,7 @@ while getopts hdfi opt; do
 			HELP=1
 			;;
 		*)
-			echo "See '$0 help' for more information." >&2
+			echo "See '$dim help' for more information." >&2
 			exit
 	esac
 done
@@ -373,7 +375,7 @@ function dim_nightly_forget
 function dim_push_branch
 {
 	if [[ "x$1" = "x" ]]; then
-		echo "usage: $0 $subcommand branch"
+		echo "usage: $dim $subcommand branch"
 		exit 1
 	fi
 
@@ -463,7 +465,7 @@ function dim_apply_next_fixes
 function dim_cherry_pick
 {
 	if [[ "x$1" = "x" ]]; then
-		echo "usage: $0 $subcommand commit-ish"
+		echo "usage: $dim $subcommand commit-ish"
 		exit 1
 	fi
 	sha=`git rev-parse $1`
@@ -583,7 +585,7 @@ function dim_magic_patch
 function dim_create_branch
 {
 	if [[ "x$1" = "x" ]]; then
-		echo "usage: $0 $subcommand branch [commit-ish]"
+		echo "usage: $dim $subcommand branch [commit-ish]"
 		exit 1
 	fi
 	branch=$1
@@ -607,7 +609,7 @@ function dim_create_branch
 function dim_remove_branch
 {
 	if [[ "x$1" = "x" ]]; then
-		echo "usage: $0 $subcommand branch"
+		echo "usage: $dim $subcommand branch"
 		exit 1
 	fi
 	branch=$1
@@ -650,7 +652,7 @@ dim_alias_co=checkout
 function dim_checkout
 {
 	if [[ "x$1" = "x" ]]; then
-		echo "usage: $0 $subcommand branch"
+		echo "usage: $dim $subcommand branch"
 		exit 1
 	fi
 
@@ -791,7 +793,7 @@ function dim_create_workdir
 	local branches
 
 	if [[ "x$1" = "x" ]]; then
-		echo "usage: $0 $subcommand branch|all"
+		echo "usage: $dim $subcommand branch|all"
 		exit 1
 	elif [[ "$1" = "all" ]] ; then
 		branches=$dim_branches
@@ -923,7 +925,7 @@ function dim_tag_next
 function dim_pull_request
 {
 	if [[ "x$1" = "x" || "x$2" = "x" ]]; then
-		echo "usage: $0 $subcommand branch upstream"
+		echo "usage: $dim $subcommand branch upstream"
 		exit 1
 	fi
 
@@ -1236,12 +1238,12 @@ function dim_help
 
 function dim_usage
 {
-	echo "usage: $0 [OPTIONS] SUBCOMMAND [ARGUMENTS]"
+	echo "usage: $dim [OPTIONS] SUBCOMMAND [ARGUMENTS]"
 	echo
 	echo "The available subcommands are:"
 	dim_list_commands | sed 's/^/\t/'
 	echo
-	echo "See '$0 help' for more information."
+	echo "See '$dim help' for more information."
 }
 
 # dim subcommand aliases
@@ -1255,6 +1257,6 @@ subcmd_func=dim_${subcmd//-/_}
 if declare -f $subcmd_func >/dev/null; then
 	$subcmd_func "$@"
 else
-	echo "$0: '$subcommand' is not a dim command." >&2
+	echo "$dim: '$subcommand' is not a dim command." >&2
 	dim_usage
 fi
-- 
2.1.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-10-13 14:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-11  8:47 [maintainer-tools PATCH 1/6] dim: refer to the script itself by basename without path Jani Nikula
2016-10-11  8:47 ` [maintainer-tools PATCH 2/6] dim: columnize usage output if column(1) is available Jani Nikula
2016-10-11  8:47 ` [maintainer-tools PATCH 3/6] dim: clean up the rm's in dim checker Jani Nikula
2016-10-11  8:47 ` [maintainer-tools PATCH 4/6] dim: add DIM_MAKE_OPTIONS configuration Jani Nikula
2016-10-11  8:47 ` [maintainer-tools PATCH 5/6] dim: add dim sparse subcommand to run sparse on a commit range Jani Nikula
2016-10-11 12:56   ` Daniel Vetter
2016-10-11  8:47 ` [maintainer-tools PATCH 6/6] dim: add command to check for dim updates Jani Nikula
2016-10-11 13:00   ` Daniel Vetter
2016-10-11 13:07     ` Jani Nikula
2016-10-13 14:50       ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox