1AppConfig::Getopt(3)  User Contributed Perl Documentation AppConfig::Getopt(3)
2
3
4

NAME

6       AppConfig::Getopt - Perl5 module for processing command line arguments
7       via delegation to Getopt::Long.
8

SYNOPSIS

10           use AppConfig::Getopt;
11
12           my $state  = AppConfig::State->new(\%cfg);
13           my $getopt = AppConfig::Getopt->new($state);
14
15           $getopt->parse(\@args);            # read args
16

OVERVIEW

18       AppConfig::Getopt is a Perl5 module which delegates to Johan Vroman's
19       Getopt::Long module to parse command line arguments and update values
20       in an AppConfig::State object accordingly.
21
22       AppConfig::Getopt is distributed as part of the AppConfig bundle.
23

DESCRIPTION

25   USING THE AppConfig::Getopt MODULE
26       To import and use the AppConfig::Getopt module the following line
27       should appear in your Perl script:
28
29           use AppConfig::Getopt;
30
31       AppConfig::Getopt is used automatically if you use the AppConfig module
32       and create an AppConfig::Getopt object through the getopt() method.
33
34       AppConfig::Getopt is implemented using object-oriented methods.  A new
35       AppConfig::Getopt object is created and initialised using the new()
36       method.  This returns a reference to a new AppConfig::Getopt object.  A
37       reference to an AppConfig::State object should be passed in as the
38       first parameter:
39
40           my $state  = AppConfig::State->new();
41           my $getopt = AppConfig::Getopt->new($state);
42
43       This will create and return a reference to a new AppConfig::Getopt
44       object.
45
46   PARSING COMMAND LINE ARGUMENTS
47       The "parse()" method is used to read a list of command line arguments
48       and update the state accordingly.
49
50       The first (non-list reference) parameters may contain a number of
51       configuration strings to pass to Getopt::Long::Configure.  A reference
52       to a list of arguments may additionally be passed or @ARGV is used by
53       default.
54
55           $getopt->parse();                       # uses @ARGV
56           $getopt->parse(\@myargs);
57           $getopt->parse(qw(auto_abbrev debug));  # uses @ARGV
58           $getopt->parse(qw(debug), \@myargs);
59
60       See Getopt::Long for details of the configuartion options available.
61
62       A Getopt::Long specification string is constructed for each variable
63       defined in the AppConfig::State.  This consists of the name, any
64       aliases and the ARGS value for the variable.
65
66       These specification string are then passed to Getopt::Long, the
67       arguments are parsed and the values in the AppConfig::State updated.
68
69       See AppConfig for information about using the AppConfig::Getopt module
70       via the getopt() method.
71

AUTHOR

73       Andy Wardley, <abw@wardley.org>
74
76       Copyright (C) 1997-2007 Andy Wardley.  All Rights Reserved.
77
78       Copyright (C) 1997,1998 Canon Research Centre Europe Ltd.
79
80       This module is free software; you can redistribute it and/or modify it
81       under the same terms as Perl itself.
82

ACKNOWLEDGMENTS

84       Many thanks are due to Johan Vromans for the Getopt::Long module.  He
85       was kind enough to offer assistance and access to early releases of his
86       code to enable this module to be written.
87

SEE ALSO

89       AppConfig, AppConfig::State, AppConfig::Args, Getopt::Long
90
91
92
93perl v5.30.0                      2019-07-26              AppConfig::Getopt(3)
Impressum