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;
(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
("\n\n" ^ protocol_limit_warning)
else "" in
- (* For DangerWillRobinson commands, we should probably have
- * guestfish prompt before allowing you to use them (especially
- * in interactive mode). XXX
- *)
- let warnings =
- warnings ^
- if List.mem DangerWillRobinson flags then
- ("\n\n" ^ danger_will_robinson)
- else "" in
-
let warnings =
warnings ^
match deprecation_notice flags with
) 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";
if List.mem ProtocolLimitWarning flags then
pr "%s\n\n" protocol_limit_warning;
- if List.mem DangerWillRobinson flags then
- pr "%s\n\n" danger_will_robinson;
-
match deprecation_notice flags with
| None -> ()
| Some txt -> pr "%s\n\n" txt