Commit 187c0922 authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

Add command-line option handling (-h and -v so far)

parent cbf621cc
......@@ -10,6 +10,45 @@
#for more details. pae2xml is provided AS IS with NO WARRANTY OF ANY KIND,
#INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
our $script = "pae2xml.pl";
our $version = "1.0";
### Handle command-line options
# import module
use Getopt::Long;
sub print_help {
print 'pae2xml.pl [OPTIONS...] FILE
Converts the Plaine & Easie file FILE to MusicXML. If FILE is -, STDIN is used.
Possible options:
-h, --help Prints out this help message
-v, -- version Prints out version information
';
}
sub print_version {
print "$script $version
Copyright (C) 2003 Rainer Typke
Copyright (C) 2010 Reinhold Kainhofer <reinhold\@kainhofer.com>
";
}
sub handle_options {
my $print_help = 0;
my $print_version = 0;
my $result = GetOptions ("help|h" => \$print_help, "version|v" => \$print_version);
if ($print_version) {
print_version ();
exit 0;
}
if ($print_help || (@ARGV == 0)) {
print_help ();
exit 0;
}
}
handle_options ();
$divisions = 960;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment