diff --git a/pae2xml.pl b/pae2xml.pl index 1bb2b7d46d45b5eef9d005019ec11cfab8011c4a..e6c4bf9810b141a3236951c977a2f5f345132a93 100755 --- a/pae2xml.pl +++ b/pae2xml.pl @@ -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;