summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2011-11-09 21:21:00 +0000
committerRichard W.M. Jones <rjones@redhat.com>2011-11-09 21:21:48 +0000
commit271f8e4b70e4acf2db96f6fe6317fda327fa5f2e (patch)
treed11203ee77604812404faa24011e77c8a71e5a39
parent145ed04e41a3fcd3be87c11cae0085f4551f1da8 (diff)
downloadlibguestfs-271f8e4b70e4acf2db96f6fe6317fda327fa5f2e.tar.gz
libguestfs-271f8e4b70e4acf2db96f6fe6317fda327fa5f2e.tar.xz
libguestfs-271f8e4b70e4acf2db96f6fe6317fda327fa5f2e.zip
fish: More informative documentation of optargs.
-rw-r--r--generator/generator_fish.ml14
1 files changed, 12 insertions, 2 deletions
diff --git a/generator/generator_fish.ml b/generator/generator_fish.ml
index 6d6a5712..4111be56 100644
--- a/generator/generator_fish.ml
+++ b/generator/generator_fish.ml
@@ -30,6 +30,13 @@ open Generator_structs
open Generator_prepopts
open Generator_c
+let doc_opttype_of = function
+ | Bool n -> "true|false"
+ | Int n
+ | Int64 n -> "N"
+ | String n -> ".."
+ | _ -> assert false
+
(* Generate a lot of different functions for guestfish. *)
let generate_fish_cmds () =
generate_header CStyle GPLv2plus;
@@ -122,7 +129,9 @@ let generate_fish_cmds () =
(String.concat ""
(List.map (fun arg -> " " ^ name_of_argt arg) args))
(String.concat ""
- (List.map (fun arg -> sprintf " [%s:..]" (name_of_argt arg)) optargs)) in
+ (List.map (fun arg ->
+ sprintf " [%s:%s]" (name_of_argt arg) (doc_opttype_of arg)
+ ) optargs)) in
let warnings =
if List.exists (function Key _ -> true | _ -> false) args then
@@ -834,7 +843,8 @@ and generate_fish_actions_pod () =
) args;
List.iter (
function
- | Bool n | Int n | Int64 n | String n -> pr " [%s:..]" n
+ | (Bool n | Int n | Int64 n | String n) as arg ->
+ pr " [%s:%s]" n (doc_opttype_of arg)
| _ -> assert false
) optargs;
pr "\n";