search for: usage_msg

Displaying 20 results from an estimated 102 matches for "usage_msg".

2018 Sep 19
0
[PATCH 1/2] mltools: create a cmdline_options struct
...line.ml b/builder/cmdline.ml index f05aecc76..bd099e218 100644 --- a/builder/cmdline.ml +++ b/builder/cmdline.ml @@ -191,7 +191,7 @@ read the man page virt-builder(1). ") prog in let opthandle = create_standard_options argspec ~anon_fun ~machine_readable:true usage_msg in - Getopt.parse opthandle; + Getopt.parse opthandle.getopt; (* Dereference options. *) let args = List.rev !args in diff --git a/builder/repository_main.ml b/builder/repository_main.ml index 554715a73..60ee96299 100644 --- a/builder/repository_main.ml +++ b/b...
2018 Aug 20
2
[PATCH 1/2] mlstdutils/mltools: factorize the machine-readable option
...ls.ml b/common/mltools/tools_utils.ml index 09f1bb544..04916b89a 100644 --- a/common/mltools/tools_utils.ml +++ b/common/mltools/tools_utils.ml @@ -229,7 +229,7 @@ let human_size i = ) ) -let create_standard_options argspec ?anon_fun ?(key_opts = false) usage_msg = +let create_standard_options argspec ?anon_fun ?(key_opts = false) ?(machine_readable = false) usage_msg = (** Install an exit hook to check gc consistency for --debug-gc *) let set_debug_gc () = at_exit (fun () -> Gc.compact()) in @@ -249,6 +249,11 @@ let create_standard_options ar...
2016 Jul 13
0
[PATCH v3 2/2] mllib: Getopt: support hidden options
...mllib/getopt.mli | 4 ++++ sysprep/main.ml | 4 ++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/mllib/getopt.ml b/mllib/getopt.ml index 90f4c44..550baa4 100644 --- a/mllib/getopt.ml +++ b/mllib/getopt.ml @@ -43,6 +43,8 @@ type t = { usage_msg : usage_msg; } +let hidden_option_description = "" + external getopt_parse : string array -> (c_keys * spec * doc) array -> ?anon_fun:anon_fun -> usage_msg -> unit = "guestfs_int_mllib_getopt_parse" let column_wrap = 38 @@ -56,6 +58,11 @@ let show_help h () =...
2016 Jul 13
3
[PATCH v3 1/2] OCaml tools: add and use a Getopt module
...- let argspec = set_standard_options argspec in let args = ref [] in let anon_fun s = push_front s args in @@ -192,7 +184,8 @@ A short summary of the options is given below. For detailed help please read the man page virt-builder(1). ") prog in - Arg.parse argspec anon_fun usage_msg; + let opthandle = create_standard_options argspec ~anon_fun usage_msg in + Getopt.parse opthandle; (* Dereference options. *) let args = List.rev !args in diff --git a/customize/Makefile.am b/customize/Makefile.am index de3d7e0..f18e238 100644 --- a/customize/Make...
2018 Aug 20
0
[PATCH 2/2] OCaml tools: simplify machine-readable handling
...-network" ], Getopt.Clear network, s_"Disable appliance network"; @@ -193,7 +190,7 @@ A short summary of the options is given below. For detailed help please read the man page virt-builder(1). ") prog in - let opthandle = create_standard_options argspec ~anon_fun usage_msg in + let opthandle = create_standard_options argspec ~anon_fun ~machine_readable:true usage_msg in Getopt.parse opthandle; (* Dereference options. *) @@ -209,7 +206,6 @@ read the man page virt-builder(1). let format = match !format with "" -> None | s -> Some s in let...
2016 Sep 19
0
[PATCH 3/3] OCaml tools: add crypto support (RHBZ#1362649)
...77 100644 --- a/customize/customize_main.ml +++ b/customize/customize_main.ml @@ -102,7 +102,7 @@ A short summary of the options is given below. For detailed help please read the man page virt-customize(1). ") prog in - let opthandle = create_standard_options argspec usage_msg in + let opthandle = create_standard_options argspec ~key_opts:true usage_msg in Getopt.parse opthandle; if not !format_consumed then @@ -175,6 +175,9 @@ read the man page virt-customize(1). g#launch (); g in + (* Decrypt the disks. *) + inspect_decrypt g; + (* Inspection....
2016 Sep 19
0
[PATCH 2/3] mllib: expose disk decrypt functionalities
...ho_keys" "noalloc" +external c_set_keys_from_stdin : unit -> unit = "guestfs_int_mllib_set_keys_from_stdin" "noalloc" + module Char = struct include Char @@ -591,7 +595,7 @@ let human_size i = ) ) -let create_standard_options argspec ?anon_fun usage_msg = +let create_standard_options argspec ?anon_fun ?(key_opts = false) usage_msg = (** Install an exit hook to check gc consistency for --debug-gc *) let set_debug_gc () = at_exit (fun () -> Gc.compact()) in @@ -604,6 +608,14 @@ let create_standard_options argspec ?anon_fun usage_msg =...
2016 Sep 19
6
[PATCH 0/3] add crypto/LUKS support in some OCaml-based tools
Hi, this series refactors some guestfish code (not much), and exposes it via Common_utils, so it is possible to decrypt LUKS partitions when using virt-customize, virt-get-kernel, virt-sparsify, and virt-sysprep. This brings them closer in features with C tools. Most probably a couple more of other OCaml-based tools (virt-v2v to convert encrypted guests, and virt-builder to use encrypted
2018 Sep 20
1
Re: [PATCH 1/2] mltools: create a cmdline_options struct
...hine_readable : unit -> machine_readable_fn option > readable output to, in case it was enabled via > [--machine-readable]. *) > > -val create_standard_options : Getopt.speclist -> ?anon_fun:Getopt.anon_fun -> ?key_opts:bool -> ?machine_readable:bool -> Getopt.usage_msg -> Getopt.t > +type cmdline_options = { > + getopt : Getopt.t; (** The actual Getopt handle. *) > +} > +(** Structure representing all the data needed for handling command > + line options. *) > + > +val create_standard_options : Getopt.speclist -> ?anon_...
2016 Jun 27
0
Re: [PATCH] RFC: OCaml tools: add and use a Getopt module
...rgspec, get_customize_ops = Customize_cmdline.argspec () in > let customize_argspec = > @@ -192,7 +185,7 @@ A short summary of the options is given below. For detailed help please > read the man page virt-builder(1). > ") > prog in > - Arg.parse argspec anon_fun usage_msg; > + Getopt.parse argspec ~anon_fun usage_msg; > > (* Dereference options. *) > let args = List.rev !args in > diff --git a/customize/Makefile.am b/customize/Makefile.am > index de3d7e0..f18e238 100644 > --- a/customize/Makefile.am > +++ b...
2016 Jun 24
2
[PATCH] RFC: OCaml tools: add and use a Getopt module
...t;; ] in let customize_argspec, get_customize_ops = Customize_cmdline.argspec () in let customize_argspec = @@ -192,7 +185,7 @@ A short summary of the options is given below. For detailed help please read the man page virt-builder(1). ") prog in - Arg.parse argspec anon_fun usage_msg; + Getopt.parse argspec ~anon_fun usage_msg; (* Dereference options. *) let args = List.rev !args in diff --git a/customize/Makefile.am b/customize/Makefile.am index de3d7e0..f18e238 100644 --- a/customize/Makefile.am +++ b/customize/Makefile.am @@ -70,6 +70...
2016 Jul 18
2
Re: [PATCH v2 2/3] mllib: Use L"..." and S '...' for long and short options.
...; + invalid_arg (sprintf "Getopt spec: L%S should not contain '_'" > + s) Why this limitation? > - let t = > - { > - specs = []; (* Set it later, with own options, and sorted. *) > - anon_fun = anon_fun; > - usage_msg = usage_msg; > - } in > - > - let specs = specs @ [ > - [ "--short-options" ], Unit (display_short_options t), hidden_option_description; > - [ "--long-options" ], Unit (display_long_options t), hidden_option_description; > - ] in > - > - (* D...
2016 Jul 11
2
[PATCH v2] OCaml tools: add and use a Getopt module
...t;; ] in let customize_argspec, get_customize_ops = Customize_cmdline.argspec () in let customize_argspec = @@ -192,7 +185,7 @@ A short summary of the options is given below. For detailed help please read the man page virt-builder(1). ") prog in - Arg.parse argspec anon_fun usage_msg; + Getopt.parse argspec ~anon_fun usage_msg; (* Dereference options. *) let args = List.rev !args in diff --git a/customize/Makefile.am b/customize/Makefile.am index de3d7e0..f18e238 100644 --- a/customize/Makefile.am +++ b/customize/Makefile.am @@ -70,6 +70...
2016 Jul 15
5
[PATCH 0/3] mllib: Various fixes and changes to Getopt module.
The second patch is obviously not complete yet - for discussion only. Rich.
2016 Jul 18
4
[PATCH v2 0/3] mllib: Various fixes and changes to Getopt module.
v1 -> v2: - Further fixes to Getopt int parsing. - Completed the L/S changes. - Fixed the test suite so it passes now. Also we don't need the special-case tests for 64 bit arch. Rich.
2017 May 22
1
[PATCH] v2v: add crypto support (RHBZ#1451665)
...l index a1338eb..70301ab 100644 --- a/v2v/cmdline.ml +++ b/v2v/cmdline.ml @@ -236,7 +236,7 @@ A short summary of the options is given below. For detailed help please read the man page virt-v2v(1). ") prog in - let opthandle = create_standard_options argspec ~anon_fun usage_msg in + let opthandle = create_standard_options argspec ~anon_fun ~key_opts:true usage_msg in Getopt.parse opthandle; (* Dereference the arguments. *) diff --git a/v2v/v2v.ml b/v2v/v2v.ml index 8cf1fad..59f5ef1 100644 --- a/v2v/v2v.ml +++ b/v2v/v2v.ml @@ -86,6...
2018 Aug 20
1
[PATCH] common/mltools: getopt: add Getopt.OptString
..., _) | Int (arg, _) | Set_int (arg, _) - | Symbol (arg, _, _) -> Some arg in + | Symbol (arg, _, _) + | OptString (arg, _) -> Some arg in (match arg with | None -> () | Some arg -> @@ -181,6 +183,7 @@ let create specs ?anon_fun usage_msg = | Set_string _ -> () | Int _ -> () | Set_int _ -> () + | OptString _ -> () | Symbol (_, elements, _) -> List.iter ( fun e -> diff --git a/common/mltools/getopt.mli b/common/mltools/getopt.mli index 2cae19bb8..b4a4f26...
2018 Sep 19
5
[PATCH 0/2] RFC: --key option for tools
Hi, the following series adds a --key option in the majority of tools: this makes it possible to pass LUKS credentials programmatically, avoid the need to manually input them, or unsafely pass them via stdin. Thanks, Pino Toscano (2): mltools: create a cmdline_options struct Introduce a --key option in tools that accept keys builder/cmdline.ml | 2 +-
2016 Jul 18
0
[PATCH v2 2/3] mllib: Use L"..." and S '...' for long and short options.
....Int ("level", set_debug), s_"Set debug level"; + [ S 'B' ], Getopt.Set_string ("path", basepath), s_"Base path of diskimage-builder library"; ] in let opthandle = create_standard_options argspec ~anon_fun:append_element usage_msg in diff --git a/generator/customize.ml b/generator/customize.ml index 0924732..259cd26 100644 --- a/generator/customize.ml +++ b/generator/customize.ml @@ -590,6 +590,7 @@ open Printf open Common_utils open Common_gettext.Gettext +open Getopt.OptionName open C...
2018 Aug 21
4
[PATCH 0/2] RFC: add output selection for --machine-readable
Hi, this is a first approach (hence RFC, since it misses tests & documentation) in selecting the output for --machine-readable. The possible choices are: * --machine-readable: to stdout, like before * --machine-readable=file:name-of-file: to the specified file * --machine-readable=stream:stdout: explicitly to stdout * --machine-readable=stream:stderr: explicitly to stderr This makes it