* `-h` | `--help`: Print usage summary.
+ * `--man` | `--manual`: Format this manual into html using `pandoc`
+ and display it with `w3m`.
+
Environment of the build command
--------------------------------
-T<arch> --target=<arch> Specify target architecture
-h --help Print this message
+ --man --manual Display complete manual (in w3m)
-s<subcommand> Treat command as `cargo <subcommand>`
--subcommand-props=<prop>,... Override command props (see docs)
exit 0;
}
+sub show_manual () {
+ my $manual = ($base_path // '.').'/README.md';
+ stat $manual or die "$self: manual not found at $manual: $!\n";;
+ exec 'sh','-ec', 'pandoc -- "$1" 2>&1 | w3m -T text/html', '--', $manual;
+ die "$self: exec sh failed: $!";
+}
+
sub read_or_enoent ($) {
my ($fn) = @_;
if (!open R, '<', $fn) {
}
} elsif (s{^--help$}{}) {
print_usage();
+ } elsif (s{^--man(?:ual)?$}{}) {
+ show_manual();
} elsif (s{^--target=}{}) {
$target = $_;
} elsif (m{^--(on|off)line$}) {