Skip to content
Snippets Groups Projects
Commit 4d931c91 authored by David Bühler's avatar David Bühler Committed by Andre Maroneze
Browse files

[Kernel] Cmdline: uses the same formatting for -explain as for -help.

-explain also indicates if the option used is an alias for another option.
parent d161ece3
No related branches found
No related tags found
No related merge requests found
......@@ -1084,13 +1084,15 @@ let list_all_plugin_options ~print_invisible =
Special processing for option "-explain" *)
(* ************************************************************************* *)
let pp_option_help option_name =
let option = Hashtbl.find Plugin.all_options option_name in
let argname = if option.argname <> "" then " " ^ option.argname else "" in
let print fmt =
Format.fprintf fmt "@[<v>%s%s@\n %s@]@."
option_name argname option.ohelp;
let pp_option_help name =
let option = Hashtbl.find Plugin.all_options name in
let help =
if option.oname = name then option.ohelp else
"alias for " ^ option.oname ^ "\n" ^ option.ohelp
in
let argname = option.argname in
let name = if argname = "" then name else name ^ " <" ^ argname ^ ">" in
let print fmt = print_helpline fmt name help option.ext_help in
Log.print_on_output print
(* [option_re] allows matching an option and extracting its name,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment