Name : perl-Getopt-Janus
| |
Version : 1.03
| Vendor : obs://build_opensuse_org/devel:languages:perl
|
Release : 6.1
| Date : 2015-01-23 02:15:26
|
Group : Development/Libraries/Perl
| Source RPM : perl-Getopt-Janus-1.03-6.1.src.rpm
|
Size : 0.09 MB
| |
Packager : (none)
| |
Summary : Getopt::Janus Perl module
|
Description :
This module is for rapid development of programs that can equally well present a simple GUI interface or present a command-line interface. It is the 80/20 attempt (i.e., 80% of the solution, gotten with just 20% of complexity that a full solution would entail) at finding a middle-ground between Getopt::* and Tk. Wherever possible, it generates help screens on its own.
This module is intended for programs that get their options (as from the command line), run (reading from or writing to files, and maybe \'print\'ing a few things to STDOUT along the way), and exit. You wouldn\'t use this to rewrite \'emacs\' or \'cron\' -- think more of the interfaces of \'touch\' or \'cal\' or maybe even \'scp\'.
Here\'s how to write a program using Getopt::Janus:
* *
Define your program\'s options with any of the functions \'string / new_file / file / yes_no / choose\'.
* *
Optionally call one of the \'license_*\' functions, to declare what license your program can be distributed under.
* *
Call \'run \\&procedure\', where \'procedure\' is a sub where you have the main work of the program (or, in turn, call routines that do the main work of the program, etc.).
Then if you call the program with no options, it will try to start up a Tk window to elicit the option values from the user. But if you specify any options at the command line (even if just the null-option \"--\"), then those options are used, and no Tk window is produced. Running it with the option \"-h\" or \"--help\" will return a help screen.
Consider this trivial program:
use strict; use Getopt::Janus; string my $n, \"-n\", \\\"Number of days from now\", \\\"The number of days from now whose date you want\"; $n = 5; run \\&main, \\\"What\'s the date in N days?\"; sub main { die \"-n has to be a number\" unless $n =~ m/^\\d+$/s; my $then = time() + $n * 24 * 60 * 60; print \"In $n days, it will be \", scalar(localtime $then), \"\ \"; }
With this named as _ndays_, you can run it any of these ways:
ndays -n=15 (report the date of 15 days from now) ndays -n 15 (same as -n=15) ndays (bring up a GUI window to ask what number of days)
ndays -- (no GUI window: run with defaults, i.e. n=5)
ndays -h (give a help screen instead of running) ndays --help (slightly more verbose than -h)
|
RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/devel:/languages:/perl:/CPAN-G/openSUSE_13.2/noarch |
Hmm ... It's impossible ;-) This RPM doesn't exist on any FTP server
Provides :
perl(Getopt::Janus)
perl(Getopt::Janus::CLI)
perl(Getopt::Janus::Facade)
perl(Getopt::Janus::Licenses)
perl(Getopt::Janus::SessionBase)
perl(Getopt::Janus::Tk)
perl-Getopt-Janus
Requires :