فهرست منبع

Improved white spaces in usage message (the printed message, the Arg code pretty much sucks)

Taddeus Kroes 12 سال پیش
والد
کامیت
6f91b8a36d
1فایلهای تغییر یافته به همراه13 افزوده شده و 10 حذف شده
  1. 13 10
      main.ml

+ 13 - 10
main.ml

@@ -62,29 +62,32 @@ let main () =
     let rec upto_usage = function
         | [] -> ""
         | (id, _, _, msg) :: tl ->
-            "\n" ^ repeat " " 8 ^ expand 10 id ^ ": " ^ msg ^ (upto_usage tl)
+            "\n" ^ repeat " " 12 ^ expand 10 id ^ ": " ^ msg ^ (upto_usage tl)
     in
     let args_spec = [
+        ("<file>", Arg.Rest (fun s -> ()),
+                 "   Optional input file (default is to read from stdin)");
+
         ("-o", Arg.String (fun s -> args.outfile <- Some s),
-            "Output file (defaults to foo.s for foo.cvc)");
+             "<file> Output file (defaults to foo.s for foo.cvc)");
 
         ("-v", Arg.Int (fun i -> args.verbose <- i),
-            "Set verbosity (0: nothing, 1: phase titles, 2: intermediate, 3: debug)");
+             "<num>  Set verbosity (0: nothing, 1: phase titles, 2: intermediate, 3: debug)");
 
         ("-nocpp", Arg.Unit (fun _ -> args.cpp <- false),
-            "Disable C preprocessor");
+                 "   Disable C preprocessor");
         ("-cpp", Arg.Unit (fun _ -> args.cpp <- true),
-            "Enable C preprocessor (overwrite earlier -nocpp)");
+               "     Enable C preprocessor (overwrite earlier -nocpp)");
 
         ("-noopt", Arg.Unit (fun _ -> args.optimize <- false),
-            "Disable optimization");
+                 "   Disable optimization");
         ("-opt", Arg.Unit (fun _ -> args.optimize <- true),
-            "Enable optimization (overwrite earlier -nocpp)");
+               "     Enable optimization (overwrite earlier -nocpp)");
 
         ("-upto", Arg.String (fun s -> args.endphase <- s),
-            "Stop after the specified phase, and print the intermediate " ^
-            "representation to stderr.\n        " ^
-            "Possible options are:" ^ upto_usage phases);
+                "<phase> Stop after the specified phase, and print the intermediate " ^
+                "representation to stderr.\n        " ^
+                "    Possible options are (in order of execution):" ^ upto_usage phases);
     ] in
 
     let usage =