From ee81c52e805961a32665f77ed269d0f2fd211213 Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Mon, 27 Feb 2012 19:23:18 +0530 Subject: [PATCH] gl-system-install learns '-h' --- src/gl-system-install | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/gl-system-install b/src/gl-system-install index 834775c..99cf075 100755 --- a/src/gl-system-install +++ b/src/gl-system-install @@ -53,7 +53,7 @@ exit 0; sub check_args { return unless @ARGV; return if @ARGV == 3; - die "I need all 3 directories (bin-dir, conf-dir, hooks-dir) or none\n"; + usage(); } sub argv_or_defaults { @@ -127,3 +127,18 @@ sub path_advice { $path_advice; #>>> } + +sub usage { + print " +Usage: + gl-system-install [bin-dir conf-dir hooks-dir] + +Requires all 3 arguments or none. All arguments supplied must be absolute +paths. The following defaults are used if arguments are not supplied: + + as normal user: \$HOME/bin, \$HOME/share/gitolite/conf, \$HOME/share/gitolite/hooks + as root: /usr/local/bin, /var/gitolite/conf, /var/gitolite/hooks +"; + exit 1; +} +