teetime: -h works.

This commit is contained in:
Ole Tange 2020-07-22 02:38:17 +02:00
parent 98907946d5
commit 0f6c5fe466

View file

@ -111,7 +111,6 @@ sub readstdin {
my $in;
my $twogb = 2**31;
open(my $fh, ($opt::append ? ">>" : ">"), $file) || die;
#open(my $fh, ">", $file) || die;
vec($rin, fileno(STDIN), 1) = 1;
while(1) {
@ -163,7 +162,7 @@ sub version() {
);
}
sub usage() {
sub help() {
# Returns: N/A
print join
("\n",
@ -179,21 +178,6 @@ sub usage() {
"",);
}
sub help() {
# Returns: N/A
print join
("\n",
"GNU $Global::progname $Global::version",
"Copyright (C) 2020 Ole Tange, http://ole.tange.dk and Free Software",
"Foundation, Inc.",
"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>",
"This is free software: you are free to change and redistribute it.",
"GNU $Global::progname comes with no warranty.",
"",
"Web site: https://gitlab.com/ole.tange/tangetools/-/tree/master/${Global::progname}\n",
);
}
$|=1;
$Global::progname = "teetime";
$Global::version = "20200721";
@ -202,6 +186,10 @@ if(GetOptions("debug|D=s" => \$opt::D,
"input|i" => \$opt::input,
"help|h" => \$opt::help,
"version|V" => \$opt::version)) {
if($opt::help) {
help();
exit(1);
}
if($opt::input) {
readfile(@ARGV);
} else {