16 exitFailure |
16 exitFailure |
17 else do |
17 else do |
18 case getOpt RequireOrder options args of |
18 case getOpt RequireOrder options args of |
19 (flags, [], []) -> |
19 (flags, [], []) -> |
20 if length args == 8 then do |
20 if length args == 8 then do |
|
21 hPutStrLn stdout $ "--------Pas2C Config--------" |
|
22 hPutStrLn stdout $ "Main module: " ++ (args !! 1) |
|
23 hPutStrLn stdout $ "Input path : " ++ (args !! 3) |
|
24 hPutStrLn stdout $ "Output path: " ++ (args !! 5) |
|
25 hPutStrLn stdout $ "Altern path: " ++ (args !! 7) |
|
26 hPutStrLn stdout $ "----------------------------" |
21 pas2C (args !! 1) ((args !! 3)++"/") ((args !! 5)++"/") ((args !! 7)++"/") |
27 pas2C (args !! 1) ((args !! 3)++"/") ((args !! 5)++"/") ((args !! 7)++"/") |
|
28 hPutStrLn stdout $ "----------------------------" |
22 else do |
29 else do |
23 if length args == 6 then do |
30 if length args == 6 then do |
|
31 hPutStrLn stdout $ "--------Pas2C Config--------" |
|
32 hPutStrLn stdout $ "Main module: " ++ (args !! 1) |
|
33 hPutStrLn stdout $ "Input path : " ++ (args !! 3) |
|
34 hPutStrLn stdout $ "Output path: " ++ (args !! 5) |
|
35 hPutStrLn stdout $ "Altern path: " ++ "./" |
|
36 hPutStrLn stdout $ "----------------------------" |
24 pas2C (args !! 1) ((args !! 3)++"/") ((args !! 5)++"/") "./" |
37 pas2C (args !! 1) ((args !! 3)++"/") ((args !! 5)++"/") "./" |
|
38 hPutStrLn stdout $ "----------------------------" |
25 else do |
39 else do |
26 error $ usageInfo header options |
40 error $ usageInfo header options |
27 (_, nonOpts, []) -> error $ "unrecognized arguments: " ++ unwords nonOpts |
41 (_, nonOpts, []) -> error $ "unrecognized arguments: " ++ unwords nonOpts |
28 (_, _, msgs) -> error $ usageInfo header options |
42 (_, _, msgs) -> error $ usageInfo header options |
29 where header = "Freepascal to C conversion! Please use -n -i -o -a options in this order.\n" |
43 where header = "Freepascal to C conversion! Please use -n -i -o -a options in this order.\n" |