App::CLI::Command(3pm)

App::CLI::Command3pm

Base class for app::cli commands

Usage

    package MyApp::List;
    use base qw(App::CLI::Command);
    use constant options => (
        'verbose'   => 'verbose',
        'n|name=s'  => 'name',
    );
    sub run {
        my ( $self, $arg ) = @_;
        print "verbose" if $self->{verbose};
        my $name = $self->{name}; # get arg following long option --name
        # anything you want this command do
    }
    # See App::CLI for information of how to invoke (sub)command.

Overview

subcommand()

    return old genre subcommand of $self;

cascading()

Return instance of cascading subcommand invoked if it was listed in your constant subcommands.

cascadable()

Return package name of subcommand if the subcommand invoked is in your constant subcommands, otherwise, return "undef".

app

Return the object referring to the current app.

brief_usage ($file)

Display a one-line brief usage of the command object. Optionally, a file could be given to extract the usage from the POD.

usage ($want_detail)

Display usage. If $want_detail is true, the "DESCRIPTION" section is displayed as well.

loc_text $text

Localizes the body of (formatted) text in $text and returns the localized version.

filename

Return the filename for the command module.

Releases

10 releases since Debian 5.0 (Lenny); the text changed 5 times.

  1. 5.0
  2. 6.0
  3. 7–8
  4. 9–11
  5. 12–13
  6. Arch

Authors

Chia-liang Kao <[email protected]>

Cornelius Lin <[email protected]>

Shelling <[email protected]>

Paul Cochrane <[email protected]> (current maintainer)

From perl-app-cli 0.52-8 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.