From 0e4142955a9096b6910149100b3dbca70c0729ad Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Sat, 15 Mar 2014 01:26:08 -0700 Subject: [PATCH] hg-fast-export.sh: clean up help text and support --help Intercept -h/--help before git-sh-setup so the proper script name can be shown instead of "hg fast-export.sh" which is wrong. Reorder the long option descriptions to be in the same order as the short usage since, as the help says, "argument order matters." --- hg-fast-export.sh | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/hg-fast-export.sh b/hg-fast-export.sh index 2bf29c1..1d84093 100755 --- a/hg-fast-export.sh +++ b/hg-fast-export.sh @@ -3,7 +3,7 @@ # Copyright (c) 2007, 2008 Rocco Rutte and others. # License: MIT -ROOT="`dirname $0`" +ROOT="`dirname "$0"`" REPO="" PFX="hg2git" SFX_MAPPING="mapping" @@ -21,19 +21,25 @@ GIT_DIR/$PFX-$SFX_STATE by default. Note: The argument order matters. Options: - -m Maximum revision to import - --quiet Passed to git-fast-import(1) - -s Enable parsing Signed-off-by lines - --hgtags Enable exporting .hgtags files - -A Read author map from file - (Same as in git-svnimport(1) and git-cvsimport(1)) - -r Mercurial repository to import - -M Set the default branch name (default to 'master') - -o Use as branch namespace to track upstream (eg 'origin') - --force Ignore validation errors when converting, and pass --force - to git-fast-import(1) + --quiet Passed to git-fast-import(1) + -r Mercurial repository to import + --force Ignore validation errors when converting, and pass --force + to git-fast-import(1) + -m Maximum revision to import + -s Enable parsing Signed-off-by lines + --hgtags Enable exporting .hgtags files + -A Read author map from file + (Same as in git-svnimport(1) and git-cvsimport(1)) + -M Set the default branch name (defaults to 'master') + -o Use as branch namespace to track upstream (eg 'origin') " - +case "$1" in + -h|--help) + echo "usage: $(basename "$0") $USAGE" + echo "" + echo "$LONG_USAGE" + exit 0 +esac . "$(git --exec-path)/git-sh-setup" cd_to_toplevel -- 2.11.4.GIT