NAME

App::FuguVM::CLI - the subcommands of fuguvm

SYNOPSIS

use App::FuguVM::CLI;

exit App::FuguVM::CLI->run(@ARGV);

DESCRIPTION

The module holds the subcommand bodies of fuguvm(1). The dispatch, the option parsing, the usage and the generic exit codes come from Fugu::CLI.

Each subcommand declares its own options in one table beside its body, so no command repeats a Getopt::Long block. _prepare applies the global options and loads the project before a body runs, and init is the one command that runs without a project. The five lifecycle commands have no body of their own: their table entry names the App::FuguVM::Guest verb, and run calls it on the loaded VM.

Command data goes to standard output; a diagnostic goes to the logger, which writes to standard error. Thus fuguvm snapshot list --names stays readable in a pipeline when the tool has something to warn about.

EXIT CODES

The generic codes come from Fugu::CLI: 0 success, 1 error, 2 invalid arguments, 3 configuration error, 7 timeout.

These are the codes that mean something to a VM:

4   the named VM is not in the configuration
5   the VM runs and the command needs it stopped
9   an expect script failed
11  the named snapshot does not exist

Code 11 is scriptable: a script that runs snapshot restore || provision-from-scratch can tell a missing layer from a real failure.

App::FuguVM::Guest uses these constants from here rather than defining the same numbers a second time.

METHODS

run

App::FuguVM::CLI->run(@argv)

Parse, dispatch and return an exit code. This is the whole of bin/fuguvm.

SEE ALSO

Fugu::CLI, App::FuguVM::Config, App::FuguVM::Guest, fuguvm(1)

AUTHOR

Dick Olsson <hi@senzilla.io>