summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans-Petter Fjeld <atluxity@1kb.no>2010-11-11 23:15:02 +0000
committerHans-Petter Fjeld <atluxity@1kb.no>2010-11-11 23:15:02 +0000
commit1f56b4d46a89b032a51126a9794909b932751e14 (patch)
tree4da546d363907b92fb1009adef36aa3673d3b08c
parenta96eb033316b8a74071ce27dd8b8e3d8ce5926b7 (diff)
la til en -h parameter som viser usage
fiksa bug med tid-visning i prompt som default usage
-rwxr-xr-xmakefront/makefront14
1 files changed, 9 insertions, 5 deletions
diff --git a/makefront/makefront b/makefront/makefront
index 2e78600..9a9b883 100755
--- a/makefront/makefront
+++ b/makefront/makefront
@@ -10,12 +10,18 @@ use strict;
use Getopt::Std;
use Text::Wrap qw($columns);
+use POSIX
print "Startet Makefront, laget for NUUG 2009.\n";
use vars qw($type $presenter $title $time $place $editor %opts);
-getopts("o:p:t:w:l:e:", \%opts);
+getopts("o:p:t:w:l:e:h", \%opts);
+
+if ($opts{h}) {
+ print "Usage: makefront [-o output] [-p presenter] [-t title] [-w time] [-l location] [-e editor] [-h]\n";
+ exit 0;
+}
if ($opts{e}) {
$editor = $opts{e};
@@ -59,6 +65,7 @@ if ($editor) {
} else {
#Spør om input til variabler
+$time = POSIX::strftime( "%d. %B %Y", localtime());
$presenter =
prompt($opts{'p'},
"Skriv inn navnet på foredragsholder (maks 25 tegn):\n");
@@ -67,14 +74,11 @@ $title =
"Skriv inn tittelen til foredraget (maks 25 tegn):\n");
$time =
prompt($opts{'w'},
- "Skriv inn tid for foredraget: (`date +%d.\ %B\ %Y`):\n");
+ "Skriv inn tid for foredraget: ($time):\n");
$place =
prompt($opts{'l'},
"Skriv inn sted for foredraget:\n");
-unless ($time) {
- $time=`date +%d.\ %B\ %Y`;
-}
my $timeplace;
unless ($place) {