Changeset 5267 for src/Pugs/Run/Args.hs

Show
Ignore:
Timestamp:
07/07/05 07:44:59 (4 years ago)
Author:
autrijus
svk:copy_cache_prev:
7266
Message:

* emulate this perl5 behaviour:

perl -e 'print CGI->VERSION' -MCGI # works
perl print_cgi_version.pl -MCGI # fails

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Run/Args.hs

    r5158 r5267  
    162162joinDashE ((Opt "-M" mod):args) = joinDashE ((Opt "-E" (";use " ++ mod ++ ";\n")):args) 
    163163 
     164-- Preserve the curious Perl5 behaviour: 
     165--   perl -e 'print CGI->VERSION' -MCGI     # works 
     166--   perl print_cgi.pl -MCGI                # fails 
     167joinDashE (x@(Opt "-e" _):y@(Opt "-E" _):args) = joinDashE (y:x:args) 
     168joinDashE ((Opt "-E" a):y@(Opt "-e" _):args) = joinDashE ((Opt "-e" a):y:args) 
     169 
    164170joinDashE ((Opt "-e" a):(Opt "-e" b):args) = 
    165171    joinDashE (Opt "-e" combined:args)