... | ... |
@@ -20,12 +20,26 @@ my $git = $app->git; |
20 | 20 |
|
21 | 21 |
my $user; |
22 | 22 |
my $only_push; |
23 |
+my $help; |
|
23 | 24 |
|
24 | 25 |
GetOptions( |
25 | 26 |
'user=s' => \$user, |
27 |
+ 'help=s' => \$help |
|
26 | 28 |
); |
27 | 29 |
|
30 |
+my $usage = <<'EOS'; |
|
31 |
+Usage: |
|
32 |
+ |
|
33 |
+ ./import_rep -u USER REPOSITORY_DIR |
|
34 |
+ |
|
35 |
+Example: |
|
36 |
+ |
|
37 |
+ ./import_rep -u kimoto reps |
|
38 |
+EOS |
|
39 |
+ |
|
40 |
+ |
|
28 | 41 |
my $rep_dir = shift; |
42 |
+die "$usage\n" if !defined $rep_dir || $help; |
|
29 | 43 |
|
30 | 44 |
# Check user |
31 | 45 |
my $user_row = $dbi->model('user')->select(id => $user)->one; |
... | ... |
@@ -85,7 +99,7 @@ for my $rep (glob "$rep_dir/*") { |
85 | 99 |
|
86 | 100 |
=head1 NAME |
87 | 101 |
|
88 |
-import_rep - create repositories |
|
102 |
+import_rep - Import existing repositories into GitPrep. |
|
89 | 103 |
|
90 | 104 |
=head1 USAGE |
91 | 105 |
|