The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

App::Dochazka::CLI::Parser - Parser for Dochazka command line client

VERSION

Version 0.096

SYNOPSIS

    use Try::Tiny;
    
    my $status;
    my @tokens = split /\s+/, 'MY SAMPLE COMMAND';
    try { 
        App::Dochazka::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/dochazka-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.

http_test_and_die

When the first token is GET, POST, PUT, or DELETE, we enter the "HTTP testing" branch of the parser, which is implemented by this routine.

As the name indicates, the routine should not return.