search for: display_short_opt

Displaying 20 results from an estimated 51 matches for "display_short_opt".

2014 Nov 26
5
[PATCH] tools: implement --short-options
...@@ main (int argc, char *argv[]) case 0: /* options which are long only */ if (STREQ (long_options[option_index].name, "long-options")) display_long_options (long_options); + else if (STREQ (long_options[option_index].name, "short-options")) + display_short_options (options); else if (STREQ (long_options[option_index].name, "format")) { OPTION_format; } else if (STREQ (long_options[option_index].name, "uuid")) { diff --git a/builder/cmdline.ml b/builder/cmdline.ml index e21d5bb..bb7b1d0 100644 --- a/builder/cmdli...
2016 May 03
1
[PATCH] mllib: add "internal" to the description of --{short, long}-options
....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 long options"; + "--short-options", Arg.Unit display_short_options, " " ^ s_"List short options (internal)"; +...
2015 Aug 31
2
[PATCH 1/2] mllib: add and use set_standard_options
...s_"Shortcut for --list-format short"; "--list-format", Arg.String list_set_format, "short|long|json" ^ " " ^ s_"Set the format for --list (default: short)"; - "--short-options", Arg.Unit display_short_options, " " ^ s_"List short options"; - "--long-options", Arg.Unit display_long_options, " " ^ s_"List long options"; "--machine-readable", Arg.Set machine_readable, " " ^ s_"Make output machine readable"; &qu...
2015 Sep 01
1
Re: [PATCH 2/2] mllib: set --debug-gc as common option
...a > couple of them which didn't have it previously. > > As implementation note, make set_debug_gc private to > set_standard_options, as it needed to be moved otherwise, and it is no > more required as public function. ACK series. I guess long_options, display_long_options and display_short_options also no longer need to be public? Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machin...
2016 Aug 25
1
Re: [PATCH 5/5] bash completion: Add missing bash completion scripts (RHBZ#1367738).
...if (STREQ (long_options[option_index].name, "fd")) { > + if (STREQ (long_options[option_index].name, "long-options")) > + display_long_options (long_options); > + else if (STREQ (long_options[option_index].name, "short-options")) > + display_short_options (options); > + else if (STREQ (long_options[option_index].name, "fd")) { > if (sscanf (optarg, "%d", &fd) != 1 || fd < 0) > error (EXIT_FAILURE, 0, _("cannot parse fd option '%s'"), optarg); > } else if (ST...
2016 Jul 13
0
[PATCH v3 2/2] mllib: Getopt: support hidden options
...h () = ); Buffer.add_string b doc; Buffer.add_char b '\n'; - ) h.specs; + ) specs; Buffer.output_buffer stdout b; exit 0 @@ -158,8 +165,8 @@ let create specs ?anon_fun usage_msg = } in let specs = specs @ [ - [ "--short-options" ], Unit (display_short_options t), s_"List short options (internal)"; - [ "--long-options" ], Unit (display_long_options t), s_"List long options (internal)"; + [ "--short-options" ], Unit (display_short_options t), hidden_option_description; + [ "--long-options" ],...
2017 Mar 24
1
[PATCH] bash: Implement tab completion for virt-win-reg (RHBZ#1367738).
...> \$merge, "encoding=s" => \$encoding, "unsafe-printable-strings" => \$unsafe_printable_strings, - ) or pod2usage (2); + "long-options" => \&display_long_options, + "short-options" => \&display_short_options); +GetOptions (%opts) or pod2usage (2); pod2usage (1) if $help; if ($version) { my $g = Sys::Guestfs->new (); @@ -238,6 +240,22 @@ if ($version) { exit } +sub display_long_options +{ + foreach (sort keys %opts) { + if (m/^(.*?)([\|=].*)?$/ && !/-options$/) {...
2016 Aug 25
7
[PATCH 0/5] bash completion: Add missing bash completion scripts (RHBZ#1367738).
This implements most of RHBZ#1367738. I didn't bother with virt-v2v-copy-to-local and virt-win-reg, but all the other tools now have full bash completion. Rich.
2016 Jul 18
2
Re: [PATCH v2 2/3] mllib: Use L"..." and S '...' for long and short options.
...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 > - > - (* Decide whether the help option can be added, and which switches use. *) > - let has_dash_help = ref false in > - let has_das...
2019 Oct 29
2
[PATCH] fish: add option --blocksize for disks
...uot;, 2, 0, 'h' }, { "connect", 1, 0, 'c' }, { "csh", 0, 0, 0 }, @@ -259,6 +261,9 @@ main (int argc, char *argv[]) display_long_options (long_options); else if (STREQ (long_options[option_index].name, "short-options")) display_short_options (options); + else if (STREQ (long_options[option_index].name, "blocksize")) { + blocksize = strtol(optarg, NULL, 0); + } else if (STREQ (long_options[option_index].name, "listen")) remote_control_listen = 1; else if (STREQ (long_option...
2015 Sep 01
3
[PATCH 1/3] mllib: make few command line options stuff private
Make print_version_and_exit, long_options, display_short_options, and display_long_options private, as set_standard_options now takes care of handling the job for the common command line options. --- mllib/common_utils.mli | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/mllib/common_utils.mli b/mllib/common_utils.mli index 79032bc..24f8f83 10...
2018 Jun 27
0
[PATCH 1/3] test-tool: implement --short-options & --long-options
...ng only */ - if (STREQ (long_options[option_index].name, "qemu")) { + if (STREQ (long_options[option_index].name, "long-options")) + display_long_options (long_options); + else if (STREQ (long_options[option_index].name, "short-options")) + display_short_options (options); + else if (STREQ (long_options[option_index].name, "qemu")) { qemu = optarg; qemu_use_wrapper = 0; } -- 2.17.1
2015 Aug 11
0
[PATCH v2 15/17] v2v: add --in-place mode
...I"; "-if", Arg.Set_string input_format, "format " ^ s_"Input format (for -i disk)"; + "--in-place", Arg.Set in_place, " " ^ s_"Only tune the guest in the input VM"; "--short-options", Arg.Unit display_short_options, " " ^ s_"List short options"; "--long-options", Arg.Unit display_long_options, " " ^ s_"List long options"; "--machine-readable", Arg.Set machine_readable, " " ^ s_"Make output machine readable"; @@ -217,...
2016 Jul 13
3
[PATCH v3 1/2] OCaml tools: add and use a Getopt module
...then str - else String.sub str i (n-i) - -let compare_command_line_args a b = - compare (String.lowercase (skip_dashes a)) (String.lowercase (skip_dashes b)) - -(* Implement `--short-options' and `--long-options'. *) -let long_options = ref ([] : (Arg.key * Arg.spec * Arg.doc) list) -let display_short_options () = - List.iter ( - fun (arg, _, _) -> - if String.is_prefix arg "-" && not (String.is_prefix arg "--") then - printf "%s\n" arg - ) !long_options; - exit 0 -let display_long_options () = - List.iter ( - fun (arg, _, _) -> -...
2020 Feb 13
0
[PATCH v3 1/1] tools: add '--blocksize' option for C-based tools
...31,6 +134,8 @@ main (int argc, char *argv[]) struct drv *drvs = NULL; const char *format = NULL; bool format_consumed = true; + int blocksize = 0; + bool blocksize_consumed = true; int c; int option_index; int exit_code; @@ -153,6 +158,8 @@ main (int argc, char *argv[]) display_short_options (options); else if (STREQ (long_options[option_index].name, "format")) { OPTION_format; + } else if (STREQ (long_options[option_index].name, "blocksize")) { + OPTION_blocksize; } else if (STREQ (long_options[option_index].name, "uuid&q...
2015 Aug 31
0
[PATCH 2/2] mllib: set --debug-gc as common option
...@@ -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-options", Arg.Unit display_long_options, " " ^ s_"List long options"; @@ -521,6 +524,7 @@ let set_standard_options argspec = "-v", Arg.Unit set_verbose, " " ^ s_...
2020 Feb 12
0
[PATCH v2 1/1] tools: add '--blocksize' option for C-based tools
...31,6 +134,8 @@ main (int argc, char *argv[]) struct drv *drvs = NULL; const char *format = NULL; bool format_consumed = true; + int blocksize = 0; + bool blocksize_consumed = true; int c; int option_index; int exit_code; @@ -153,6 +158,8 @@ main (int argc, char *argv[]) display_short_options (options); else if (STREQ (long_options[option_index].name, "format")) { OPTION_format; + } else if (STREQ (long_options[option_index].name, "blocksize")) { + OPTION_blocksize; } else if (STREQ (long_options[option_index].name, "uuid&q...
2020 Feb 13
2
[PATCH v3 0/1] tools: add '--blocksize' option for C-based tools
From: Nikolay Ivanets <stenavin@gmail.com> This patch depends on changes in 'common' sub-module posted here: https://www.redhat.com/archives/libguestfs/2020-February/msg00150.html v3 fixes issue found during code review: - options now appear in alphabetical order v2: Almost the same as v1 except '--blocksize' option description is moved into a common submodule (similar to
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.