Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[enhance] help/manpages: global pass for improving help messages of O…

…pa binaries
  • Loading branch information...
commit 9a4a8eed969d7a5d7ce5e35a30d0c079ab993176 1 parent 4a27a07
Mathieu Baudet authored
View
3  compilerlib/opadep.sh
@@ -14,7 +14,8 @@ OPA_PACKAGES='lib/opa/stdlib'
help() {
cat <<EOF
-opadep.sh: generate OPA packages dependency graphs.
+opadep: generate OPA packages dependency graphs.
+Usage: opadep [options]
Packages are expected to be found in the following folders :
. all packages previously compiled in the current path
MLSTATELIBS/$OPA_PACKAGES all installed packages
View
50 dissemination/spawn.sh
@@ -116,24 +116,40 @@ a single local database server, and provides a local load-balancing front-end
to access them via HTTP.
Options:
- --help -h Displays the current help and exits
- --host <[user@]host[:port]>[,n] Specifies a host to use for distribution.
- The user will be used for login, your service will be run on
- the given port. n specifies the number of instances you want,
- each running on port 'port+n'.
- --host-pem <[user@]host[:port]>[,n] Specifies a host to use for distribution with public-key.
- The user will be used for login, your service will be run on
- the given port. n specifies the number of instances you want,
- each running on port 'port+n'. (see '--pem' option)
- --pem <path> Specify a public-key to connect to host. Will be used with
- hosts declared with '--host-pem' option.
- --opa-port <port> Use the given http port by default on the
- opa services (default: $DEFAULT_PORT)
- --haproxy <path> The path to your haproxy binary (default: $HAPROXY_BIN)
- --port <port> The main port to listen on (default: $HAPROXY_PORT)
- --opa-db-server <path> Specifies the path to the Opa database server binary
- --no-db Does not set up any remote database server
+ --help -h
+ Displays the current help and exits
+ --host <[user@]host[:port]>[,n]
+ Specifies a host to use for distribution.
+ The user will be used for login, your service will be run on
+ the given port. n specifies the number of instances you want,
+ each running on port 'port+n'.
+
+ --host-pem <[user@]host[:port]>[,n]
+ Specifies a host to use for distribution with public-key.
+ The user will be used for login, your service will be run on
+ the given port. n specifies the number of instances you want,
+ each running on port 'port+n'. (see '--pem' option)
+
+ --pem <path>
+ Specify a public-key to connect to host. Will be used with
+ hosts declared with '--host-pem' option.
+
+ --opa-port <port>
+ Use the given http port by default on the
+ opa services (default: $DEFAULT_PORT)
+
+ --haproxy <path>
+ The path to your haproxy binary (default: $HAPROXY_BIN)
+
+ --port <port>
+ The main port to listen on (default: $HAPROXY_PORT)
+
+ --opa-db-server <path>
+ Specifies the path to the Opa database server binary
+
+ --no-db
+ Does not set up any remote database server
EOF
}
View
2  libbase/testfilepos.ml
@@ -96,7 +96,7 @@ let positions, options =
]))
(fun _ -> prerr_endline "anonymous argument not allowed\ntry --help"; exit 2)
- "citation extractor"
+ (Printf.sprintf "%s: citation extractor\nUsage: %s [options]\nOptions:" Sys.argv.(0) Sys.argv.(0))
in
let options = { FilePos.
truncate_lines = !truncate_lines ;
View
9 libbsl/bslbrowser.ml
@@ -176,9 +176,8 @@ let anon_fun file =
let usage_msg =
- !> "@{<bright>%s@} <Opa External Libraries Browser> %s\nuse: %s [options] [regexps] [bsl-plugins]"
- Sys.argv.(0) BuildInfos.version_id
- Sys.argv.(0)
+ !> "@{<bright>%s@}: Opa External Libraries Browser\nUsage: %s [options] [regexps] [bsl-plugins]\n"
+ Sys.argv.(0) Sys.argv.(0)
let parse () =
@@ -194,7 +193,7 @@ let parse () =
|> Arg.align
in
- Arg.parse spec anon_fun usage_msg
+ Arg.parse spec anon_fun (usage_msg^"Options:")
(* ============= *)
@@ -550,7 +549,7 @@ let tiny_shell
BslRegisterParserState.init_file ~filename:"stdin" ;
let () =
- Printf.fprintf stdout "Opa-plugin-browser %s %s\n"
+ Printf.fprintf stdout "bslbrowser %s %s\n"
BuildInfos.opa_version_name BuildInfos.version_id ;
Printf.fprintf stdout "Type \"help\" for more information.\n%!"
in
View
7 libbsl/bslregister.ml
@@ -511,9 +511,8 @@ let anon_fun file =
let usage_msg =
- !> "@{<bright>%s@} <Opa External Libraries Register> %s\nuse: %s [options] files"
- Sys.argv.(0) BuildInfos.version_id
- Sys.argv.(0)
+ !> "@{<bright>%s@}: Opa External Libraries Register\nUsage: %s [options] files\n"
+ Sys.argv.(0) Sys.argv.(0)
let parse () =
@@ -529,7 +528,7 @@ let parse () =
|> Arg.align
in
- Arg.parse spec anon_fun usage_msg ;
+ Arg.parse spec anon_fun (usage_msg^"Options:") ;
finalize_options ()
View
1  manpages/trx.synopsis
@@ -0,0 +1 @@
+trx [options] syntax_file.[trx|prx]
View
4 opa/checkopacapi.ml
@@ -108,7 +108,7 @@ let spec = [
let anon_fun file = MutableList.add files file
let usage_msg =
- !> "@{<bright>%s@} <Opa Compiler Interface Validator> %s\nuse: %s [options] stdlib-files"
+ !> "@{<bright>%s@}: Opa Compiler Interface Validator %s\nUsage: %s [options] stdlib-files\n"
Sys.argv.(0) BuildInfos.version_id
Sys.argv.(0)
@@ -123,7 +123,7 @@ let parse () =
|> Arg.align
in
- Arg.parse spec anon_fun usage_msg
+ Arg.parse spec anon_fun (usage_msg^"Options:")
(**
Folding input file, and applying a fold on the parsed code
View
2  opalang/opa2opa.ml
@@ -23,7 +23,7 @@ let _ =
["--expr",Arg.Unit (fun () -> opt_expr := true),"print expressions as expressions (do not insert \"do\")"]
)
(fun _ -> ())
- (Printf.sprintf "%s : simple qml to opa preprocessing\nuse : %s [options] <filein.opa >fileout.opa\n" Sys.argv.(0) Sys.argv.(0))
+ (Printf.sprintf "%s: simple qml to opa preprocessing\nUsage: %s [options] <filein.opa >fileout.opa\nOptions:" Sys.argv.(0) Sys.argv.(0))
let _ =
if !opt_expr then
View
4 passlib/passdesign.ml
@@ -729,6 +729,8 @@ let _ =
] in
+ let usage_msg = Printf.sprintf "%s: Testing tool and code example on the internals of the Opa compiler.\nUsage: %s [options]\n" Sys.argv.(0) Sys.argv.(0) in
+
let _ =
Arg.parse
(Arg.align
@@ -739,5 +741,5 @@ let _ =
@ WarningClass.Arg.options
@ OManager.Arg.options
))
- ignore "passdesign" in
+ ignore (usage_msg^"Options:") in
Main.binop ()
View
4 pplib/pprocess.ml
@@ -295,10 +295,12 @@ module Exe = struct
"Output to files using the given suffix instead of stdout")
]
+ let usage_msg = Printf.sprintf "%s: Simple preprocessor for the needs of the Opa compiler \nUsage: %s [options] <files>\n" Sys.argv.(0) Sys.argv.(0)
+
let parse () =
Arg.parse speclist
(fun file -> files := file::!files)
- "pprocess"
+ (usage_msg^"Options:")
(* Get a file content (cc from File) *)
let content f =
View
6 protocols/mlidl.ml
@@ -3451,7 +3451,7 @@ let process_inbuilt_options = List.iter (function
| _ -> assert false)
let files = ref ([]:string list)
-let usage = "mlidl {options} <mlidl file>\n"
+let usage = Printf.sprintf "%s: generation tool for Opalang low-level IDL\nUsage: %s [options] <file>\n" Sys.argv.(0) Sys.argv.(0)
let translate_file file =
let tynames, exts, idls, sars, opns, lets = read_idl_file file in
@@ -3507,9 +3507,9 @@ let _ =
"\tDebug (currently does nothing).");
]
(fun str -> files := (!files)@[str])
- (usage^"Options:\n");
+ (usage^"Options:");
if !files = []
- then printf "%s\n" usage
+ then printf "%s" usage
else List.iter (fun file ->
restore_opts !default_opts;
bslmns := prefixmodname !bsl_prefix ".mlidl" file;
View
3  protocols/wsdl2ml.ml
@@ -1828,7 +1828,8 @@ let translate_file debug filename =
List.iter (make_service ctxt phargmap filename) svcs;
close_out oc
-let usage = "wsdl2ml {options} <wsdl file>\n"
+let usage = Printf.sprintf "%s: code generation for WSDL stubs\nUsage: %s [options] <wsdl file>\n" Sys.argv.(0) Sys.argv.(0)
+
let _ =
Arg.parse
[("--debug-name", (Arg.String (fun s -> myname := s)), "<string>\tPrint debug info for named type.");
View
4 qml2js/qml2jsOptions.ml
@@ -307,10 +307,12 @@ struct
target = target ;
}
+ let usage_msg = Printf.sprintf "%s: command-line options for the Qml-to-JS compiler\nUsage: %s [options]\n" Sys.argv.(0) Sys.argv.(0)
+
(** parse *)
let parse () =
reset () ;
- Arg.parse (speclist ()) anon_fun "<qml2jslib>" ;
+ Arg.parse (speclist ()) anon_fun (usage_msg ^ "Options:");
let o = build_argv_options () in
let module M = (val (find_backend o.backend) : JsBackend) in
{o with extra_lib = M.runtime_libs ~cps:o.cps }
View
4 teerex/trx_interpreter.ml
@@ -369,6 +369,8 @@ let str2memo = function
| "full" -> T.MemoFull
| s -> failwith (pr "Unknown memoization option: '%s' (should be: 'none', 'fail', 'success' or 'full')" s)
+let usage_msg = Printf.sprintf "%s: parser interpreter for the Opa project\nUsage: %s [options] syntax_file.[trx|prx]\n" Sys.argv.(0) Sys.argv.(0)
+
let parse_args () =
let anon_fun s =
if !grammarFile = None then
@@ -412,7 +414,7 @@ let parse_args () =
" default memoization level for rules with no annotations [none | fail | success | full]");
]) anon_fun
- (Printf.sprintf "%s <options> syntax_file.[trx|prx] input_file" Sys.argv.(0))
+ (usage_msg^"Options:")
let load_grammar grammarFn =
let peg, _ = Pgrammar.read_grammar ?memo_default:!memo_default ~verbose:true None grammarFn in
View
4 teerex/trx_ocaml.ml
@@ -1409,6 +1409,8 @@ let optimize_memoization peg =
(* ============================================ Cmd. line + main ============================================= *)
(* =========================================================================================================== *)
+let usage_msg = Printf.sprintf "%s: Ocaml parser generator for the Opa project\nUsage: %s [options] syntax_file.[trx|prx]\n" Sys.argv.(0) Sys.argv.(0)
+
let parse_args () =
let anon_fun s = grammarFn := Some s in
Arg.parse (Arg.align [
@@ -1501,7 +1503,7 @@ let parse_args () =
" RULE produces parser with 'main' function parsing with given production")
]) anon_fun
- (Printf.sprintf "%s <options> syntax_file.[trx|prx]" Sys.argv.(0))
+ (usage_msg^"Options:")
let set_bool_option opt v var =
match v with
View
4 tools/odep.ml
@@ -554,7 +554,7 @@ let spec = [
]
-let usage_msg = Printf.sprintf "bld ocaml dependencies graphs generator\nuse: %s *.mllib *.depends\n" Sys.argv.(0)
+let usage_msg = Printf.sprintf "%s: graphs generator for ocaml dependencies\nUsage: %s *.mllib *.depends\n" Sys.argv.(0) Sys.argv.(0)
let anon_fun file =
match File.extension file with
@@ -567,7 +567,7 @@ let anon_fun file =
exit 1
let parse () =
- Arg.parse spec anon_fun usage_msg
+ Arg.parse spec anon_fun (usage_msg^"Options:")
let _ =
parse ();
View
4 tools/odeplink.ml
@@ -192,7 +192,7 @@ let spec = [
" Add external link. e.g. : path/to/file/$(NODE).html"
]
-let usage_msg = Printf.sprintf "svg hyperlink adder\nuse: %s *.svg\n" Sys.argv.(0)
+let usage_msg = Printf.sprintf "%s: svg hyperlink adder\nUsage: %s *.svg\n" Sys.argv.(0) Sys.argv.(0)
let anon_fun file =
match File.extension file with
@@ -203,7 +203,7 @@ let anon_fun file =
exit 1
let parse () =
- Arg.parse spec anon_fun usage_msg
+ Arg.parse spec anon_fun (usage_msg^"Options:")
let _ =
parse ();
View
2  tools/ofile.ml
@@ -75,6 +75,6 @@ let _ =
"-path", Arg.Set_string path, "<dir> prefix directory for files"
]
(fun t -> iter_of !path t; empty := false)
- (Printf.sprintf "%s : embedded file ocaml preprocessor" Sys.argv.(0));
+ (Printf.sprintf "%s: embedded file ocaml preprocessor\nUsage: %s [options]\nOptions:" Sys.argv.(0) Sys.argv.(0));
if !empty
then error (Printf.sprintf "no input files (give me some \"%s\" file)" extension)
Please sign in to comment.
Something went wrong with that request. Please try again.