From 101f23830f4fcc4a101c287db5b1b750e53a91a8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Javier=20Fern=C3=A1ndez-Sanguino?= Date: Wed, 8 Mar 2017 22:17:46 +0000 Subject: [PATCH] Add help command line and print usage information git-svn-id: https://projectaon.org/data/trunk@2577 f6f3e2d7-ff33-0410-aaf5-b4bee2cdac11 --- common/scripts/gblint.pl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/common/scripts/gblint.pl b/common/scripts/gblint.pl index 0caf1b4..85e5ced 100755 --- a/common/scripts/gblint.pl +++ b/common/scripts/gblint.pl @@ -174,6 +174,10 @@ while( $#ARGV > -1 && $ARGV[ 0 ] =~ /^-/ ) { shift @ARGV; $language = shift @ARGV; } + elsif( $ARGV[ 0 ] eq '-h' ) { + usage(); + exit 0; + } } my $lineNumber = 1; @@ -343,3 +347,16 @@ sub printError { ++$errorCount; if( $maxErrorCount > 0 && $errorCount > $maxErrorCount ) { die "Maximum number of errors ($maxErrorCount) exceeded. Quitting.\n"; } } + +sub usage { + print "Gamebook lintian checker - reads from standard input a gamebook XML file and prints out possible errors\n\n"; + print "Usage: gblint.pl [-e ] [-s ] [-i ] [--use-corr] [--skip-ASCII-check] [--language CODE]\n"; + print "Options:\n"; + print "\t-e \tStops when NUMBER errors have been reached (by default it does not stop)\n"; + print "\t-s \tSkips NUMBER of lines before analysing\n"; + print "\t-i \tAdds TEXT to error messages (default: '??')\n"; + print "\t--use-corr\tPrints correction in report (default: disabled)\n"; + print "\t--skip-ASCII-check\tDoes not check for non-ASCCI characters (default: enabled)\n"; + print "\t--language CODE\tDefines the language of the gamebook file (default: 'en'\n"; + print "\t-h\tPrint this help and exit\n"; +} -- 2.17.1