From: <har...@us...> - 2008-01-16 00:22:33
|
Revision: 4696 http://net-policy.svn.sourceforge.net/net-policy/?rev=4696&view=rev Author: hardaker Date: 2008-01-15 16:22:35 -0800 (Tue, 15 Jan 2008) Log Message: ----------- document improved CGI interface Modified Paths: -------------- trunk/net-policy/perl/Getopt_GUI/Long.pm Modified: trunk/net-policy/perl/Getopt_GUI/Long.pm =================================================================== --- trunk/net-policy/perl/Getopt_GUI/Long.pm 2008-01-16 00:04:33 UTC (rev 4695) +++ trunk/net-policy/perl/Getopt_GUI/Long.pm 2008-01-16 00:22:35 UTC (rev 4696) @@ -818,15 +818,11 @@ providing automatic good-looking usage output without the programmer needing to write usage() functions. -=head1 HISTORY + This also can turn normal command line programs into web CGI scripts + as well (automatically). If the Getopt::GUI::Long program is + installed as a CGI script then it will automatically prompt the user + for the same variables. -This module was originally named Getopt::Long::GUI but the -Getopt::Long author wanted to reserve the Getopt::Long namespace -entirely for himself and thus it's been recently renamed to -Getopt::GUI::Long instead. The class tree isn't as clean this way, as -this module still inherits from Getopt::Long but it everything still -works of course. - =head1 USAGE The Getopt::GUI::Long module can work identically to the Getopt::Long @@ -1210,6 +1206,30 @@ return @opts; } +=head1 Usage as a CGI Script + +If a Getopt::GUI::Long script is installed as a CGI script, then the +Getopt::GUI::Long system will automatically create a web front end for +the perl script. It will present the user with all the normal +arguments that it would normally to a Gtk2 or other windowing system. + +It will not present the box for generic additional arguments since +this is not safe to do. If you trust your users (ie, you have an +authentication system in place) then you can set the I<allowcgiargs> +GUI variable to make this box appear. Example invocation (not +generally recommended): + + ['GUI:allowcgiargs',1] + +It also allows you to not present certain options to web users that +you will to command line users (some options may not be safe for CGI +use). You can do this by setting the I<nocgi> variable in option +definitions you wish to disallow via CGI. E.G., if you had an option +to specify a location where to load configuration a file from, this +would likely be unsafe to publish in a CGI script. So remove it: + + ["c|config-file","Load a specific configuration file", nocgi => 1] + =head1 EXAMPLES See the getopttest program in the examples directory for an exmaple @@ -1234,6 +1254,15 @@ modules: QWizard +=head1 HISTORY + +This module was originally named Getopt::Long::GUI but the +Getopt::Long author wanted to reserve the Getopt::Long namespace +entirely for himself and thus it's been recently renamed to +Getopt::GUI::Long instead. The class tree isn't as clean this way, as +this module still inherits from Getopt::Long but it everything still +works of course. + =cut 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |