Permalink
Browse files

NF: assigning version 1.2 since 1.1 was in previous life, also --vers…

…ion, --help and --manpage to use help2man to generate a manpage
  • Loading branch information...
1 parent 4253999 commit 19b2f67eeedc81cffc1e6980ae38f793c9005325 @yarikoptic committed Mar 14, 2010
Showing with 24 additions and 1 deletion.
  1. +24 −1 git-bzr
View
25 git-bzr
@@ -7,6 +7,8 @@
# Bidirectional operation with Bazaar repositories. Add remote branches, pull
# from them and push to them using this script.
+gitbzr_version='1.2'
+
function gitbzr_help_header() {
echo >&2 "git-bzr - Bidirectional operation between Bazaar and git"
}
@@ -36,7 +38,16 @@ function gitbzr_help_all() {
echo >&2 "Arguments are detailed in each command's help message. For more"
echo >&2 "information, use 'git bzr help <command>'"
echo >&2
- exit 1
+}
+
+function gitbzr_print_version() {
+cat << EOT
+git-bzr (bash version) $gitbzr_version
+Copyright (C) of respective authors (see AUTHORS).
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+EOT
}
function perror() {
@@ -227,12 +238,24 @@ function gitbzr_help() {
;;
* )
gitbzr_help_all
+ exit 1
;;
esac
}
function gitbzr_run() {
if [ $# -lt 2 ] ; then
+ if [ "x$1" = "x--version" ]; then
+ gitbzr_print_version
+ exit 0
+ elif [ "x$1" = "x--help" ]; then
+ gitbzr_help_all 2>&1
+ exit 0
+ elif [ "x$1" = "x--manpage" ]; then
+ help2man -N $0
+ exit 0
+ fi
+
gitbzr_help $1
fi

0 comments on commit 19b2f67

Please sign in to comment.