# Usage, invalid arguments.
-my $usage =
+use Pod::Usage;
+my $usage = ( $Pod::Usage::VERSION < 1.65 ?
'Usage:
blhc [*options*] *<dpkg-buildpackage build log file>..*
-';
+'
+ :
+ 'Usage:
+ blhc [options] <dpkg-buildpackage build log file>..
+
+');
is_blhc '', '--invalid', 2,
"Unknown option: invalid\n"
. $usage;
is_blhc '', '--help', 1,
qr/^Usage:
- blhc \[\*options\*\] \*<dpkg-buildpackage build log file>\.\.\*
+ blhc \[\*?options\*?\] \*?<dpkg-buildpackage build log file>\.\.\*?
Options:
/s;
# Invalid option.
is_blhc 'ignore-flag', '--ignore-arch-flag -g', 2,
- 'Value "-g" invalid for option ignore-arch-flag ("arch:flag" expected)
-Usage:
- blhc [*options*] *<dpkg-buildpackage build log file>..*
-
-';
+ 'Value "-g" invalid for option ignore-arch-flag ("arch:flag" expected)'
+ . "\n$usage";
is_blhc 'ignore-flag', '--ignore-arch-flag -g:', 2,
- 'Value "-g:" invalid for option ignore-arch-flag ("arch:flag" expected)
-Usage:
- blhc [*options*] *<dpkg-buildpackage build log file>..*
-
-';
+ 'Value "-g:" invalid for option ignore-arch-flag ("arch:flag" expected)'
+ . "\n$usage";
is_blhc 'ignore-flag', '--ignore-arch-flag :amd64', 2,
- 'Value ":amd64" invalid for option ignore-arch-flag ("arch:flag" expected)
-Usage:
- blhc [*options*] *<dpkg-buildpackage build log file>..*
-
-';
+ 'Value ":amd64" invalid for option ignore-arch-flag ("arch:flag" expected)'
+ . "\n$usage";
# Wrong architecture.
is_blhc 'ignore-flag', '--ignore-arch-flag amd64:-g', 8,
# Invalid option.
is_blhc 'ignore-line', '--ignore-arch-line .+', 2,
- 'Value ".+" invalid for option ignore-arch-line ("arch:line" expected)
-Usage:
- blhc [*options*] *<dpkg-buildpackage build log file>..*
-
-';
+ 'Value ".+" invalid for option ignore-arch-line ("arch:line" expected)'
+ . "\n$usage";
is_blhc 'ignore-line', '--ignore-arch-line .+:', 2,
- 'Value ".+:" invalid for option ignore-arch-line ("arch:line" expected)
-Usage:
- blhc [*options*] *<dpkg-buildpackage build log file>..*
-
-';
+ 'Value ".+:" invalid for option ignore-arch-line ("arch:line" expected)'
+ . "\n$usage";
is_blhc 'ignore-line', '--ignore-arch-line :amd64', 2,
- 'Value ":amd64" invalid for option ignore-arch-line ("arch:line" expected)
-Usage:
- blhc [*options*] *<dpkg-buildpackage build log file>..*
-
-';
+ 'Value ":amd64" invalid for option ignore-arch-line ("arch:line" expected)'
+ . "\n$usage";
# Wrong architecture.
is_blhc 'ignore-line', '--ignore-arch-line "amd64:.+"', 8,