Changeset 4537

Show
Ignore:
Timestamp:
06/11/05 15:58:18 (4 years ago)
Author:
iblech
svk:copy_cache_prev:
6289
Message:

Pugs.Help -- Minor cosmetic fix.
pugs::run -- Wrote section about Pugs' command line flags.

Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lib/pugs/run.pod

    r4532 r4537  
    11=head1 NAME 
    22 
    3 pugs::run - how to execute the Pugs interpreter 
     3pugs::run - How to execute Pugs 
    44 
    55=head1 SYNOPSYS 
     
    1010     S<[ B<-C>I<backend> [I<file>] ]> 
    1111     S<[ B<-B>I<backend> [I<file>] ]> 
     12     S<[ B<-M>I<module> ]> 
    1213     S<[ B<--external> [I<file>] ] > 
    1314     S<[ B<-e> I<program> ]> 
     
    2324WRITEME 
    2425 
    25 =head2 Command Switches 
     26=head2 Command line options 
    2627 
    27 WRITEME 
     28You can pass various command line options to Pugs. 
     29 
     30=over 
     31 
     32=item C<-e I<program>> 
     33 
     34causes Pugs to not look for any program files in the command line options, but 
     35instead run the one-line program specified. Multiple C<-e> commands work too. 
     36 
     37=item C<-n> 
     38 
     39causes Pugs to assume the following loop around your program, which makes it 
     40iterate over filename arguments somewhat like sed -n or awk: 
     41 
     42    while =<> { 
     43        ...your program here... 
     44    } 
     45 
     46=item C<-p> 
     47 
     48causes Pugs to assume the following loop around your program, which makes it 
     49iterate over filename arguments somewhat like sed: 
     50 
     51    while =<> { 
     52        ...your program here... 
     53        say; 
     54    } 
     55 
     56=item C<-c> 
     57 
     58causes Pugs to not run the program, but merely check its syntax. 
     59 
     60Note that C<BEGIN {...}> and C<CHECK {...}> blocks, as well as C<use Module>, 
     61are still executed, because these might change the grammar or create new 
     62operators, etc. So the following is B<not> safe: 
     63 
     64    pugs -c 'BEGIN { system "evil command" }' 
     65 
     66If you want to run a potentially unsafe program safely, see the safemode Pugs 
     67provides. 
     68 
     69=item C<-BI<backend>> 
     70 
     71causes Pugs to execute the program using C<I<backend>>. Currently, valid 
     72backends are C<Pugs>, C<Parrot>, and C<Haskell>. 
     73 
     74=item C<-CI<backend>> 
     75 
     76causes Pugs to compile the program using C<I<backend>>. Currently, valid 
     77backends are C<Pugs>, C<Parrot>, and C<Haskell>. 
     78 
     79Note that, as with C<-c>, C<BEGIN {...}> and C<CHECK {...}> blocks, as well as 
     80C<use Module>, are still executed. So don't try to compile potentially unsafe 
     81code! 
     82 
     83=item C<-MI<module>> 
     84 
     85causes Pugs to load C<I<module>> before executing your program: 
     86 
     87    use module; 
     88    ...your code here... 
     89 
     90=item C<-h> or C<--help> 
     91 
     92outputs a short summary of the available command line options. No programs are 
     93executed. 
     94 
     95=item C<-V> 
     96 
     97outputs the version of Pugs you're running and long configuration information. 
     98 
     99=item C<-V:I<item>> 
     100 
     101outputs short configuration information for C<I<item>>. 
     102 
     103    $ pugs -V:pugs_version 
     104    pugs_versnum: 6.2.6 
     105 
     106=item C<-v> or C<--version> 
     107 
     108outputs the version of Pugs you're running. 
     109 
     110=item C<-l>, C<-d>, and C<-w> 
     111 
     112are ignored for compatibility with Perl 5. 
     113 
     114=back 
    28115 
    29116=head1 ENVIRONMENT 
    30117 
    31 The pugs runtime environment is affected by several environment variables. 
     118The Pugs runtime environment is affected by several environment variables. 
    32119 
    33120The build environment is likewise controlled by several environment variables; 
    34 since pugs is still in heavy development, they will be listed here as well. 
     121since Pugs is still in heavy development, they will be listed here as well. 
    35122 
    36123=over 
  • src/Pugs/Help.hs

    r3726 r4537  
    4444        putStrLn "-Cbackend        compile using the compiler backend" 
    4545        putStrLn "                 (valid backends are: Pugs, Parrot, Haskell)" 
    46         putStrLn "-M module        execute 'use module' before executing the program" 
     46        putStrLn "-Mmodule         execute 'use module' before executing the program" 
    4747        putStrLn "-h or --help     give this message" 
    4848        putStrLn "-V               long configuration information & version"