• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

examples/H25-Feb-2013-6647

Long.pmH A D25-Feb-201336.9 KiB1,331542

MANIFESTH A D22-Jun-2007146 87

META.ymlH A D22-Jun-2007298 119

Makefile.PLH A D19-Dec-2007267 116

READMEH A D22-Jun-20073 KiB9163

README

1MODULE
2
3  Getopt::GUI::Long - a drop in Getopt::Long replacement supporting an
4  optional GUI
5
6SYNOPSIS
7
8  use Getopt::GUI::Long;
9
10  # pass useful config options to Configure
11  Getopt::GUI::Long::Configure(qw(display_help no_ignore_case capture_output));
12  GetOptions(\%opts,
13             ["GUI:separator",   "Important Flags:"],
14	     ["f|some-flag=s",   "A flag based on a string"],
15	     ["o|other-flag",    "A boloean"],
16            );
17
18  # or use references instead of a hash (less tested, however):
19
20  GetOptions(["some-flag=s",  "perform some flag based on a value"] => \$flag,
21             ["other-flag=s", "perform some flag based on a value"] => \$other);
22
23  # displays auto-help given the input above:
24
25  % opttest -h
26  Usage: opttest [OPTIONS] Other Arguments
27
28  OPTIONS:
29
30  Important Flags:
31     -f STRING             A flag based on a string
32     -o                    A boloean
33
34  Help Options:
35     -h                    Display help options -- short flags preferred
36    --help                 Display help options -- long flags preferred
37    --help-full            Display all help options -- short and long
38
39
40
41  # or long help:
42
43  % opttest --help
44  Usage: opttest [OPTIONS] Other Arguments
45
46  OPTIONS:
47
48  Important Flags:
49    --some-flag=STRING     A flag based on a string
50    --other-flag           A boloean
51
52  Help Options:
53     -h                    Display help options -- short flags preferred
54    --help                 Display help options -- long flags preferred
55    --help-full            Display all help options -- short and long
56
57  # or a GUI screen:
58
59  (see http://net-policy.sourceforge.net/images/getopt_example.png )
60
61DESCRIPTION
62
63  This module is a wrapper around Getopt::Long that extends the value of
64  the original Getopt::Long module to:
65
66  1) add a simple graphical user interface option screen if no
67     arguments are passed to the program.  Thus, the arguments to
68     actually use are built based on the results of the user
69     interface. If arguments were passed to the program, the user
70     interface is not shown and the program executes as it normally
71     would and acts just as if Getopt::Long::GetOptions had been
72     called instead.
73
74  2) provide an auto-help mechanism such that -h and --help are
75     handled automatically.  In fact, calling your program with -h
76     will default to showing the user a list of short-style arguments
77     when one exists for the option.  Similarly --help will show the
78     user a list of long-style when possible.  --help-full will list
79     all potential arguments for an option (short and long both).
80
81  It's designed to make the creation of graphical shells trivial
82  without the programmer having to think about it much as well as
83  providing automatic good-looking usage output without the
84  programmer needing to write usage() functions.
85
86EXAMPLE SCREEN SHOTS
87
88  http://www.dnssec-tools.org/ has a bunch of screen shot links on the
89  front page where the GUI interface from it is entirely created
90  through the Getopt::GUI::Long interface.
91