search for: getopt_parse

Displaying 13 results from an estimated 13 matches for "getopt_parse".

2013 Jan 02
12
[Bug 1980] use updated ssh-copy-id
https://bugzilla.mindrot.org/show_bug.cgi?id=1980 dajoker at gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dajoker at gmail.com --- Comment #6 from dajoker at gmail.com --- The ' openssh-unix-dev at mindrot.org' mailing list thread
2013 Feb 07
8
[Bug 1980] use updated ssh-copy-id
https://bugzilla.mindrot.org/show_bug.cgi?id=1980 Damien Miller <djm at mindrot.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |1614, 1669, 1822, 1823, | |2068 --- Comment #18 from Damien Miller
2016 Jul 11
0
Re: [PATCH v2] OCaml tools: add and use a Getopt module
...'-' then > + raise (Invalid_argument (sprintf "invalid option key: '%s'" key)) Whereever you've written 'raise (Invalid_argument ...)' you can replace it with 'invalid_arg ...'. > + let specs = specs @ [ > + (* Handled internally by getopt_parse. *) > + [ "-h"; "-help"; "--help" ], Unit (fun () -> ()), s_"Display brief help"; As above. Also I think it would be worth adding a check that we don't have duplicate options in the list. Personally I'd still like to see the L/S stuff, but...
2016 Jul 13
0
[PATCH v3 2/2] mllib: Getopt: support hidden options
...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 () = let prologue = sprintf (f_"%s\nOptions:\n") h.usage_msg in Buffer.add_str...
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 Jun 24
2
[PATCH] RFC: OCaml tools: add and use a Getopt module
...<caml/alloc.h> +#include <caml/fail.h> +#include <caml/memory.h> +#include <caml/mlvalues.h> +#include <caml/callback.h> +#include <caml/printexc.h> + +#include <guestfs.h> +#include "guestfs-internal-frontend.h" + +extern value guestfs_int_mllib_getopt_parse (value argsv, value specsv, value anon_funv, value usage_msgv); + +#define Val_none Val_int(0) + +static void +xwrite (int fd, const void *v_buf, size_t len) +{ + int r; + const char *buf = v_buf; + + while (len > 0) { + r = write (fd, buf, len); + if (r == -1) + error (EXIT_FAILUR...
2016 Jul 11
2
[PATCH v2] OCaml tools: add and use a Getopt module
...<caml/alloc.h> +#include <caml/fail.h> +#include <caml/memory.h> +#include <caml/mlvalues.h> +#include <caml/callback.h> +#include <caml/printexc.h> + +#include <guestfs.h> +#include "guestfs-internal-frontend.h" + +extern value guestfs_int_mllib_getopt_parse (value argsv, value specsv, value anon_funv, value usage_msgv); + +#define Val_none Val_int(0) + +#ifdef HAVE_ATTRIBUTE_CLEANUP +#define CLEANUP_FREE_OPTION_LIST __attribute__((cleanup(cleanup_option_list))) + +static void +cleanup_option_list (void *ptr) +{ + struct option *opts = * (struct optio...
2016 Jul 13
3
[PATCH v3 1/2] OCaml tools: add and use a Getopt module
...<assert.h> + +#include <caml/alloc.h> +#include <caml/fail.h> +#include <caml/memory.h> +#include <caml/mlvalues.h> +#include <caml/callback.h> +#include <caml/printexc.h> + +#include "guestfs-internal-frontend.h" + +extern value guestfs_int_mllib_getopt_parse (value argsv, value specsv, value anon_funv, value usage_msgv); + +#define Val_none Val_int(0) + +#ifdef HAVE_ATTRIBUTE_CLEANUP +#define CLEANUP_FREE_OPTION_LIST __attribute__((cleanup(cleanup_option_list))) + +static void +cleanup_option_list (void *ptr) +{ + struct option *opts = * (struct optio...
2016 Jun 27
0
Re: [PATCH] RFC: OCaml tools: add and use a Getopt module
...e specified ones, > sorting them, and setting [long_options] to them. > > diff --git a/mllib/getopt-c.c b/mllib/getopt-c.c > new file mode 100644 > index 0000000..d44448f > --- /dev/null > +++ b/mllib/getopt-c.c > @@ -0,0 +1,398 @@ > +value > +guestfs_int_mllib_getopt_parse (value argsv, value specsv, value anon_funv, value usage_msgv) I'm not convinced that this function is safe against OCaml GC compaction. In particular there are problems such as: ... > + for (j = 0; j < len; ++j) { > + const char *key = String_val (Field (keysv, j)); key no...
2016 Jul 18
0
[PATCH v2 2/3] mllib: Use L"..." and S '...' for long and short options.
...t) | Set_int of string * int ref -type keys = string list +module OptionName = struct + type option_name = S of char | L of string +end +open OptionName + +type keys = option_name list type doc = string type usage_msg = string type anon_fun = (string -> unit) @@ -49,6 +54,14 @@ external getopt_parse : string array -> (c_keys * spec * doc) array -> ?anon_fun let column_wrap = 38 +let string_of_option_name = function + | S c -> sprintf "-%c" c + | L s -> "--" ^ s + +let string_of_option_name_no_dashes = function + | S c -> String.make 1 c + | L s ->...
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.
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.