App::Cmd::ArgProcessor - App::Cmd-specific wrapper for Getopt::Long::Descriptive


App-Cmd documentation Contained in the App-Cmd distribution.

Index


Code Index:

NAME

Top

App::Cmd::ArgProcessor - App::Cmd-specific wrapper for Getopt::Long::Descriptive

VERSION

Top

version 0.311

AUTHOR

Top

Ricardo Signes <rjbs@cpan.org>

COPYRIGHT AND LICENSE

Top


App-Cmd documentation Contained in the App-Cmd distribution.

use strict;
use warnings;

package App::Cmd::ArgProcessor;
BEGIN {
  $App::Cmd::ArgProcessor::VERSION = '0.311';
}
# ABSTRACT: App::Cmd-specific wrapper for Getopt::Long::Descriptive

sub _process_args {
  my ($class, $args, @params) = @_;
  local @ARGV = @$args;

  require Getopt::Long::Descriptive;
  Getopt::Long::Descriptive->VERSION(0.084);

  my ($opt, $usage) = Getopt::Long::Descriptive::describe_options(@params);

  return (
    $opt,
    [ @ARGV ], # whatever remained
    usage => $usage,
  );
}

1;

__END__