diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-04-04 11:09:31 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-04-05 11:34:24 +0000 |
commit | cdd49851abf4aed4f960c4d7cef6c3bd08d5a961 (patch) | |
tree | 682a7094786aca1c7a14e64532fe8d2d5d8bff32 /tests/prebuild | |
parent | e521ac18a54babb2d4f2b3584d5bfdc521352b6a (diff) |
tst_licenses.pl: Add command line help
Use pod2usage() to display help.
Change-Id: Ie2537466f35445909569c1f37627af24fbaecab8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Simo Fält <simo.falt@qt.io>
Diffstat (limited to 'tests/prebuild')
-rwxr-xr-x | tests/prebuild/license/tst_licenses.pl | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/prebuild/license/tst_licenses.pl b/tests/prebuild/license/tst_licenses.pl index 9277f497..bce716bc 100755 --- a/tests/prebuild/license/tst_licenses.pl +++ b/tests/prebuild/license/tst_licenses.pl @@ -42,6 +42,7 @@ use File::Spec::Functions; use Getopt::Long; use Cwd qw( abs_path getcwd ); use List::Util qw( first ); +use Pod::Usage; use Test::More; =head1 NAME @@ -52,7 +53,8 @@ tst_licenses.pl - verify that source files contain valid license headers perl ./tst_licenses.pl [OPTION] - -f Force usage of find() to create the list of instead of git ls-files + -f Force use of find() to create the list of files instead of git ls-files + -h|? Display this help This test expects the environment variable QT_MODULE_TO_TEST to contain the path to the Qt module to be tested. @@ -68,6 +70,7 @@ headers. my @moduleOptionalFiles; my @moduleExcludedFiles; my $optForceFind = 0; +my $optHelp = 0; # These modules are not expected to contain any files that need # Qt license headers. They are entirely excluded from license checking. @@ -660,12 +663,10 @@ sub run checkLicense($_); } } - } -if (!GetOptions('f' => \$optForceFind)) { - exit (1); -} +GetOptions('f' => \$optForceFind, "help|?" => \$optHelp) or pod2usage(2); +pod2usage(0) if $optHelp; run(); done_testing(); |