NAME

Review::Helper::CLI - The review-helper command.

DESCRIPTION

Parses the command line of review-helper and runs one subcommand. A first argument that names no subcommand is taken as a review file to serve.

Each subcommand is a class, such as Review::Helper::CLI::Note, that declares its options with Getopt::Yath and provides run($settings, @args). Options may appear anywhere after the subcommand name; the remaining arguments, including everything after --, are passed to run in order. A lone - (standard input) is an argument; options after it are not parsed.

Option values are decoded from UTF-8 before the subcommand sees them: they are text, such as note sentences, titles, revisions and path specs. Positional arguments and the --file, --out and --port-command options name files or commands and are passed on as given, as bytes.

Output goes to standard output. Errors go to standard error, prefixed with the subcommand, and give a non-zero exit code.

SYNOPSIS

use Review::Helper::CLI;

exit(Review::Helper::CLI->run(@ARGV));

PUBLIC METHODS

$exit = Review::Helper::CLI->run(@args)

Run the command line @args and return the exit code: 0 on success, 1 on any error.

$text = Review::Helper::CLI->usage()

The usage message printed when no arguments are given.

Review::Helper::CLI->run_command($command_class, @args)

Load $command_class, parse its options out of @args, and call its run. Dies on invalid options or when the subcommand fails.

Review::Helper::CLI->decode_settings($settings)

Decode every parsed option value from UTF-8 to characters, in place, except --file, --out and --port-command. Dies when a value is not valid UTF-8.

$text = Review::Helper::CLI->decode_arg($name, $bytes)

Decode one value of option $name from UTF-8. Returns undef for undef.

SOURCE

The source code repository for Review-Helper can be found at https://github.com/exodist/Review-Helper.

MAINTAINERS

Chad Granum <exodist7@gmail.com>

AUTHORS

Chad Granum <exodist7@gmail.com>

COPYRIGHT

Copyright Chad Granum <exodist7@gmail.com>.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See https://dev.perl.org/licenses/