source: text-formbuilder/trunk/bin/fb.pl @ 85

Last change on this file since 85 was 53, checked in by peichman, 20 years ago

separated basic parser using code out into a separate Class::ParseText::Base base class; updated docs, manifest, and changelog

File size: 1.8 KB
RevLine 
[1]1use strict;
2use warnings;
3
4use Getopt::Long;
5use Text::FormBuilder;
6
7GetOptions(
8    'o=s' => \my $outfile,
9    'D=s' => \my %fb_options,
10);
11my $src_file = shift;
12
[52]13create_form($src_file, \%fb_options, $outfile);
14#Text::FormBuilder->parse($src_file)->build(%fb_options)->write($outfile);
[1]15
16=head1 NAME
17
18fb - Frontend script for Text::FormBuilder
19
20=head1 SYNOPSIS
21
22    $ fb my_form.txt -o form.html
23   
24    $ fb my_form.txt -o my_form.html -D action=/cgi-bin/my-script.pl
25
[52]26=head1 DESCRIPTION
27
28Parses a formspec file from the command line and creates an output
29file. The sort of output file depends on the value given to the C<-o>
30option. If it ends in F<.pm>, a standalone module is created. If it
31ends in F<.pl> or F<.cgi>, a skeleton CGI script is created. Any other
32value, will be taken as the name of an HTML file to write. Finally, if
33not C<-o> option is given then the HTML will be written to STDOUT.
34
[1]35=head1 OPTIONS
36
37=over
38
[52]39=item C<< -D <parameter>=<value> >>
[1]40
41Define options that are passed to the CGI::FormBuilder object. For example,
42to create a form on a static html page, and have it submitted to an external
43CGI script, you would want to define the C<action> parameter:
44
45    $ fb ... -D action=/cgi-bin/some_script.pl
46
[52]47=item C<< -o <output file> >>
48
49Where to write output, and what form to write it in. See C<create_form> in
50L<Text::FormBuilder> for a more detailed explanation.
51
52    # write a standalone module
53    $ fb myform -o MyForm.pm
54   
55    # write a CGI script
56    $ fb myform -o form.cgi
[53]57    $ fb myform -o form.pl
[52]58
59=back
60
61=head1 AUTHOR
62
63Peter Eichman, C<< <peichman@cpan.org> >>
64
65=head1 COPYRIGHT AND LICENSE
66
67Copyright E<copy>2004 by Peter Eichman.
68
69This program is free software; you can redistribute it and/or
70modify it under the same terms as Perl itself.
71
72=cut
Note: See TracBrowser for help on using the repository browser.