File: ArgProcessor.pm

package info (click to toggle)
libapp-cmd-perl 0.307-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 404 kB
  • ctags: 262
  • sloc: perl: 2,390; makefile: 2
file content (34 lines) | stat: -rw-r--r-- 546 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
use strict;
use warnings;

package App::Cmd::ArgProcessor;

=head1 NAME

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

=head1 VERSION

version 0.307

=cut

our $VERSION = '0.307';

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;