Changeset 5158

Show
Ignore:
Timestamp:
07/03/05 18:07:32 (4 years ago)
Author:
iblech
svk:copy_cache_prev:
6965
Message:

* Made "pugs -MFoo file.p6" work (previously, file.p6 wasn't executed).
* Added a test for this to t/pugsrun/10-dash-uppercase-m.t.

Files:
1 added
3 modified

Legend:

Unmodified
Added
Removed
  • src/Main.hs

    r4972 r5158  
    8585 
    8686run (("-e"):prog:args)          = do doRun "-e" args prog 
     87-- -E is like -e, but not accessible as a normal parameter and used only 
     88-- internally: 
     89--   "-e foo bar.p6" executes "foo" with @*ARGS[0] eq "bar.p6", 
     90--   "-E foo bar.p6" executes "foo" and then bar.p6. 
     91run (("-E"):prog:rest)          = run ("-e":prog:[]) >> run rest 
    8792run ("-":args)                  = do doRun "-" args =<< readStdin 
    8893run (file:args)                 = readFile file >>= doRun file args 
  • src/Pugs/Run/Args.hs

    r5001 r5158  
    156156                                   isDashE (_) = False 
    157157 
    158 joinDashE ((Opt "-M" mod):args) = joinDashE ((Opt "-e" ("use " ++ mod ++ ";\n")):args) 
     158-- -E is like -e, but not accessible as a normal parameter and used only 
     159-- internally: 
     160--   "-e foo bar.p6" executes "foo" with @*ARGS[0] eq "bar.p6", 
     161--   "-E foo bar.p6" executes "foo" and then bar.p6. 
     162joinDashE ((Opt "-M" mod):args) = joinDashE ((Opt "-E" (";use " ++ mod ++ ";\n")):args) 
    159163 
    160164joinDashE ((Opt "-e" a):(Opt "-e" b):args) = 
  • t/pugsrun/10-dash-uppercase-m.t

    r4253 r5158  
    1818my @tests = ( 
    1919  "-I$dir -MDummy -e load_test", 
    20   "-e load_test -MDummy -I$dir" 
     20  "-e load_test -MDummy -I$dir", 
     21  "-I$dir -MDummy $dir/10-dash-uppercase-m.p6" 
    2122); 
    2223