NAME
Web::MREST::CLI::Parser - Parser for demo MREST command line client
SYNOPSIS
use
Try::Tiny;
my
$status
;
my
@tokens
=
split
/\s+/,
'MY SAMPLE COMMAND'
;
try
{
Web::MREST::CLI::Parse::parse_tokens( [], \
@tokens
);
}
catch
{
$status
=
$_
;
};
CLI COMMANDS
The parsing of CLI commands takes place in the parse_tokens
function, which calls itself recursively until it gets to a rather macabre-sounding
die
send_req . . .
This causes control to return to the while loop in bin/mrest-cli
with the return value of the send_req
, which is a status object.
All tokens should be chosen to be distinguishable by their first three characters.