Displaying 20 results from an estimated 156 matches for "argspec".
2015 Aug 31
2
[PATCH 1/2] mllib: add and use set_standard_options
...ot;--version", Arg.Unit print_version_and_exit,
- " " ^ s_"Display version and exit";
- "-x", Arg.Unit set_trace, " " ^ s_"Enable tracing of libguestfs calls";
] in
let customize_argspec, get_customize_ops = Customize_cmdline.argspec () in
let customize_argspec =
List.map (fun (spec, _, _) -> spec) customize_argspec in
let argspec = argspec @ customize_argspec in
- let argspec =
- let cmp (arg1, _, _) (arg2, _, _) =
- let arg1 = skip_dashes arg1 and arg2 = sk...
2018 Sep 19
0
[PATCH 1/2] mltools: create a cmdline_options struct
...nged, 28 insertions(+), 15 deletions(-)
diff --git a/builder/cmdline.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_...
2016 Jun 27
0
Re: [PATCH] RFC: OCaml tools: add and use a Getopt module
...top_builddir)/mllib/planner.cmo \
> diff --git a/builder/cmdline.ml b/builder/cmdline.ml
> index eee8367..7a59ac2 100644
> --- a/builder/cmdline.ml
> +++ b/builder/cmdline.ml
> @@ -119,54 +119,47 @@ let parse_cmdline () =
> let warn_if_partition = ref true in
>
> let argspec = [
> - "--arch", Arg.Set_string arch, "arch" ^ " " ^ s_"Set the output architecture";
> - "--attach", Arg.String attach_disk, "iso" ^ " " ^ s_"Attach data disk/ISO during install";
> - &q...
2016 Jun 24
2
[PATCH] RFC: OCaml tools: add and use a Getopt module
...$(top_builddir)/mllib/fsync.cmo \
$(top_builddir)/mllib/planner.cmo \
diff --git a/builder/cmdline.ml b/builder/cmdline.ml
index eee8367..7a59ac2 100644
--- a/builder/cmdline.ml
+++ b/builder/cmdline.ml
@@ -119,54 +119,47 @@ let parse_cmdline () =
let warn_if_partition = ref true in
let argspec = [
- "--arch", Arg.Set_string arch, "arch" ^ " " ^ s_"Set the output architecture";
- "--attach", Arg.String attach_disk, "iso" ^ " " ^ s_"Attach data disk/ISO during install";
- "--attach-fo...
2016 Jul 11
2
[PATCH v2] OCaml tools: add and use a Getopt module
...$(top_builddir)/mllib/fsync.cmo \
$(top_builddir)/mllib/planner.cmo \
diff --git a/builder/cmdline.ml b/builder/cmdline.ml
index 6085b45..462554a 100644
--- a/builder/cmdline.ml
+++ b/builder/cmdline.ml
@@ -119,54 +119,47 @@ let parse_cmdline () =
let warn_if_partition = ref true in
let argspec = [
- "--arch", Arg.Set_string arch, "arch" ^ " " ^ s_"Set the output architecture";
- "--attach", Arg.String attach_disk, "iso" ^ " " ^ s_"Attach data disk/ISO during install";
- "--attach-fo...
2016 Jul 13
3
[PATCH v3 1/2] OCaml tools: add and use a Getopt module
...$(top_builddir)/mllib/fsync.cmo \
$(top_builddir)/mllib/planner.cmo \
diff --git a/builder/cmdline.ml b/builder/cmdline.ml
index 6085b45..846c2e3 100644
--- a/builder/cmdline.ml
+++ b/builder/cmdline.ml
@@ -119,60 +119,52 @@ let parse_cmdline () =
let warn_if_partition = ref true in
let argspec = [
- "--arch", Arg.Set_string arch, "arch" ^ " " ^ s_"Set the output architecture";
- "--attach", Arg.String attach_disk, "iso" ^ " " ^ s_"Attach data disk/ISO during install";
- "--attach-fo...
2018 Aug 20
2
[PATCH 1/2] mlstdutils/mltools: factorize the machine-readable option
...] calls function [f] with [filename]
diff --git a/common/mltools/tools_utils.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 +...
2015 Jan 21
2
[PATCH] customize: add --commands-from-file
...mmands are handled in the same order as they are in the file,
+as if they were specified as I<--delete /some/file> on the command
+line.";
+ };
+
{ op_name = "delete";
op_type = String "PATH";
op_discrim = "`Delete";
@@ -474,7 +498,7 @@ let rec argspec () =
| target :: lns -> target, lns
in
- let argspec = [
+ let rec argspec = [
";
List.iter (
@@ -569,6 +593,18 @@ let rec argspec () =
pr " s_\"%s\" ^ \" \" ^ s_\"%s\"\n" v shortdesc;
pr " ),\n";...
2018 Aug 20
0
[PATCH 2/2] OCaml tools: simplify machine-readable handling
...;
[ L"no-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 -&...
2017 Oct 04
1
Re: [PATCH 2/9] ocaml: Replace pattern matching { field = field } with { field }.
...rep/sysprep_operation.ml
> +++ b/sysprep/sysprep_operation.ml
> @@ -172,7 +172,7 @@ let extra_args () =
> assert !baked;
>
> List.flatten (
> - List.map (fun { extra_args = extra_args } ->
> + List.map (fun { extra_args } ->
> List.map (fun { extra_argspec = argspec } -> argspec) extra_args
The last line here can be also simplified too?
--
Pino Toscano
2016 Sep 19
0
[PATCH 2/3] mllib: expose disk decrypt functionalities
...s_int_mllib_set_echo_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 ?a...
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
0
[PATCH v2 2/3] mllib: Use L"..." and S '...' for long and short options.
...ine.ml
index 846c2e3..49a57ee 100644
--- a/builder/cmdline.ml
+++ b/builder/cmdline.ml
@@ -20,6 +20,7 @@
open Common_gettext.Gettext
open Common_utils
+open Getopt.OptionName
open Customize_cmdline
@@ -119,46 +120,46 @@ let parse_cmdline () =
let warn_if_partition = ref true in
let argspec = [
- [ "--arch" ], Getopt.Set_string ("arch", arch), s_"Set the output architecture";
- [ "--attach" ], Getopt.String ("iso", attach_disk), s_"Attach data disk/ISO during install";
- [ "--attach-format" ]...
2016 Jul 18
3
[PATCH v4 0/2] mllib: Various fixes and changes to Getopt module.
v3 -> v4:
- Pushed the first patch upstream since it was ACKed.
- Prevent use of M except for the special virt-v2v options.
- Sort the options after added --help etc.
- Make corresponding fixes to the tests.
Rich.
2016 Jul 18
4
[PATCH v3 0/3] mllib: Various fixes and changes to Getopt module.
v2 -> v3:
- Add M variant and test it.
Rich.
2015 Aug 31
0
[PATCH 2/2] mllib: set --debug-gc as common option
...ryrun, " " ^ s_"Perform a dry run";
diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml
index 2b7d88d..62d72b1 100644
--- a/mllib/common_utils.ml
+++ b/mllib/common_utils.ml
@@ -511,6 +511,9 @@ let display_long_options () =
exit 0
let set_standard_options argspec =
+ (** Install an exit hook to check gc consistency for --debug-gc *)
+ let set_debug_gc () =
+ at_exit (fun () -> Gc.compact()) in
let argspec = [
"--short-options", Arg.Unit display_short_options, " " ^ s_"List short options";
"--long-optio...
2016 May 03
1
[PATCH] mllib: add "internal" to the description of --{short, long}-options
...ash completion scripts.
---
mllib/common_utils.ml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml
index 3d6eb94..db8a298 100644
--- a/mllib/common_utils.ml
+++ b/mllib/common_utils.ml
@@ -575,8 +575,8 @@ let set_standard_options argspec =
let set_debug_gc () =
at_exit (fun () -> Gc.compact()) in
let argspec = [
- "--short-options", Arg.Unit display_short_options, " " ^ s_"List short options";
- "--long-options", Arg.Unit display_long_options, " " ^ s_"List...
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.
2015 Sep 01
3
[PATCH 1/3] get-kernel: split command line handling in own function
...rror (f_"--domain option can only be given once");
- domain := Some dom
- and set_prefix p =
- if !prefix <> None then
- error (f_"--prefix option can only be given once");
- prefix := Some p in
-
- let ditto = " -\"-" in
- let argspec = [
- "-a", Arg.String set_file, s_"file" ^ " " ^ s_"Add disk image file";
- "--add", Arg.String set_file, s_"file" ^ " " ^ s_"Add disk image file";
- "-c", Arg.Set...
2016 Sep 19
0
[PATCH 3/3] OCaml tools: add crypto support (RHBZ#1362649)
....ml
index 07fd790..5613277 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;
+
(* I...