search for: generate_fish_cmd

Displaying 20 results from an estimated 38 matches for "generate_fish_cmd".

Did you mean: generate_fish_cmds
2016 Apr 11
1
[PATCH] fish: improve formatting of help text of generated commands
...@ fish_commands) [] in List.sort func_compare all +let c_quoted_indented ~indent str = + let str = c_quote str in + let str = replace_str str "\\n" ("\\n\"\n" ^ indent ^ "\"") in + str + (* Generate a lot of different functions for guestfish. *) let generate_fish_cmds () = generate_header CStyle GPLv2plus; @@ -138,7 +143,7 @@ let generate_fish_cmds () = pr "struct command_entry %s_cmd_entry = {\n" name; pr " .name = \"%s\",\n" name2; - pr " .help = \"%s\",\n" (c_quote text); + pr &...
2009 Sep 11
2
[PATCH] generator.ml: Fix string list memory leak
...sts are allocated by malloc, but were never freed. --- src/generator.ml | 16 +++++++++++++++- 1 files changed, 15 insertions(+), 1 deletions(-) diff --git a/src/generator.ml b/src/generator.ml index 7571f95..c72c329 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -6320,7 +6320,7 @@ and generate_fish_cmds () = | OptString n | FileIn n | FileOut n -> pr " const char *%s;\n" n - | StringList n | DeviceList n -> pr " char *const *%s;\n" n + | StringList n | DeviceList n -> pr " char **%s;\n" n | Bool n -> pr...
2009 Aug 17
1
[PATCH libguestfs] generator.ml: do not emit unused print_* functions
..._lvm_vg, print_inotify_event, that are not used. --- src/generator.ml | 17 ++++++++++++----- 1 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/generator.ml b/src/generator.ml index 1e717db..9f2b8cf 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -6129,11 +6129,6 @@ and generate_fish_cmds () = ) cols; pr "}\n"; pr "\n"; - pr "static void print_%s (struct guestfs_%s *%s)\n" typ typ typ; - pr "{\n"; - pr " print_%s_indent (%s, \"\");\n" typ typ; - pr "}\n"; - pr "...
2009 Aug 17
2
[PATCH libguestfs] generator.ml: do not emit unused print_*_list functions
...ion only if it will be used. --- src/generator.ml | 36 ++++++++++++++++++++++++------------ 1 files changed, 24 insertions(+), 12 deletions(-) diff --git a/src/generator.ml b/src/generator.ml index ac01a98..03dc52b 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -6063,6 +6063,21 @@ and generate_fish_cmds () = pr "}\n"; pr "\n"; + let emit_print_list_function typ = + pr "static void print_%s_list (struct guestfs_%s_list *%ss)\n" + typ typ typ; + pr "{\n"; + pr " int i;\n"; + pr "\n"; + pr " for (i = 0; i...
2010 Jun 01
1
[PATCH] fish: help command return error for non-existent commands (RHBZ#597145).
...n int display_command (const char *cmd); extern int run_action (const char *cmd, int argc, char *argv[]); /* in completion.c (auto-generated) */ diff --git a/src/generator.ml b/src/generator.ml index 2c33049..571ea3a 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -7575,7 +7575,7 @@ and generate_fish_cmds () = pr "\n"; (* display_command function, which implements guestfish -h cmd *) - pr "void display_command (const char *cmd)\n"; + pr "int display_command (const char *cmd)\n"; pr "{\n"; List.iter ( fun (name, style, _, flags, _, shortde...
2009 Nov 19
1
[PATCH libguestfs] syntax-check: expand TABs in generator.ml
...& r == %s)\n" error_code; + pr " /* do_%s has already called reply_with_error */\n" name; + pr " goto done;\n"; + pr "\n" ); (* If there are any FileOut parameters, then the impl must @@ -6684,8 +6684,8 @@ and generate_fish_cmds () = pr " pod2text (\"%s\", _(\"%s\"), %S);\n" name2 shortdesc ("=head1 SYNOPSIS\n\n " ^ synopsis ^ "\n\n" ^ - "=head1 DESCRIPTION\n\n" ^ - longdesc ^ warnings ^ describe_alias); + "=head1 DESCRI...
2014 Dec 02
1
Re: [PATCH v2] fish: show synopsis if command syntax is wrong
.../* Synopsis. */ > > /* The run_* function. */ > int (*run) (const char *cmd, size_t argc, char *argv[]); > diff --git a/generator/fish.ml b/generator/fish.ml > index 3f53ffa..b609ce9 100644 > --- a/generator/fish.ml > +++ b/generator/fish.ml > @@ -98,6 +98,10 @@ let generate_fish_cmds () = > pr "/* Valid suffixes allowed for numbers. See Gnulib xstrtol function. */\n"; > pr "static const char *xstrtol_suffixes = \"0kKMGTPEZY\";\n"; > pr "\n"; > + pr "/* Return these errors from run_* functions. */\n"; >...
2016 Sep 02
6
[PATCH 0/4] generator: Some work to split large C files
By splitting up large C files we can make parallel compiles a bit faster. Rich.
2014 Dec 01
2
[PATCH v2] fish: show synopsis if command syntax is wrong
...fprintf (stderr, _(\"%%s: unknown command\\n\"), cmd);\n"; pr " if (command_num == 1)\n"; pr " extended_help_message ();\n"; - pr " return -1;\n"; pr " }\n"; + pr " return ret;\n"; pr "}\n" and generate_fish_cmds_h () = -- 1.9.3
2009 Aug 21
9
enable -Werror and all of gcc's warning options
Here is a bunch of small patches to make fish/ build with most warnings enabled: [1/9] edit.c: avoid warning about signed/unsigned comparison [2/9] fish.c: avoid warnings [3/9] tilde.c: avoid a warning [4/9] fish.c: avoid "assignment discards qualifiers..." warning [5/9] fish.c: avoid signed/unsigned-comparison warning [6/9] fish.c: don't perform arithmetic on void*
2009 Sep 24
1
enabling more syntax-checks
...leading whitespace. */\n"; + pr " while (*p && c_isspace (*p)) /* Skip any leading whitespace. */\n"; pr " p++;\n"; pr "\n"; pr " if (!*p) { /* Empty line? Skip it. */\n"; @@ -6073,9 +6073,9 @@ and generate_fish_cmds () = pr "#include <stdlib.h>\n"; pr "#include <string.h>\n"; pr "#include <inttypes.h>\n"; - pr "#include <ctype.h>\n"; pr "\n"; pr "#include <guestfs.h>\n"; + pr "#include \"c-ctyp...
2009 Sep 11
1
[PATCH] guestfish: Enable grouping in string lists
...sdb1" + command "/bin/echo 'foo bar'" + command "/bin/echo \'foo\'" =head1 WILDCARDS AND GLOBBING diff --git a/src/generator.ml b/src/generator.ml index db37228..9b2600f 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -6361,7 +6361,8 @@ and generate_fish_cmds () = pr " %s = strcmp (argv[%d], \"-\") != 0 ? argv[%d] : \"/dev/stdout\";\n" name i i | StringList name | DeviceList name -> - pr " %s = parse_string_list (argv[%d]);\n" name i + pr &...
2009 Sep 11
1
[FOR REVIEW ONLY] guestfish: Enable grouping in string lists
...NULL; + + /* NULL terminate the argument list */ + argv = realloc(argv, sizeof(*argv) * argv_i + 1); + argv[argv_i] = NULL; return argv; } diff --git a/src/generator.ml b/src/generator.ml index 5cf6a94..7571f95 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -6348,7 +6348,8 @@ and generate_fish_cmds () = pr " %s = strcmp (argv[%d], \"-\") != 0 ? argv[%d] : \"/dev/stdout\";\n" name i i | StringList name | DeviceList name -> - pr " %s = parse_string_list (argv[%d]);\n" name i + pr &...
2009 Nov 09
1
[PATCH libguestfs] indent with spaces, not TABs
...; n + pr " string %s<>;\n" n | OptString n -> pr " str *%s;\n" n | StringList n | DeviceList n -> pr " str %s<>;\n" n | Bool n -> pr " bool %s;\n" n @@ -6581,11 +6581,11 @@ and generate_fish_cmds () = function | Device name | String name -> - pr " %s = argv[%d];\n" name i + pr " %s = argv[%d];\n" name i | Pathname name | Dev_or_Path name -> - pr " %s = resolve_win_path (argv[%d...
2014 Dec 17
3
[PATCH 0/3] Allow environment variables to have boolean values.
https://bugzilla.redhat.com/show_bug.cgi?id=1175196 Currently if you write something like LIBGUESTFS_DEBUG=0 or LIBGUESTFS_DEBUG=true then it doesn't do what you probably expect. This patch series fixes that. Rich.
2009 Nov 09
1
use STREQ(a,b), not strcmp(a,b) == 0
...if (!name) goto error; - if (strcasecmp (name, key) == 0) { + if (STRCASEEQ (name, key)) { ret = values[i]; break; } diff --git a/src/generator.ml b/src/generator.ml index 17519fe..3a25c57 100644 --- a/src/generator.ml +++ b/src/generator.ml @@ -6430,11 +6430,11 @@ and generate_fish_cmds () = else "" in pr " if ("; - pr "strcasecmp (cmd, \"%s\") == 0" name; + pr "STRCASEEQ (cmd, \"%s\")" name; if name <> name2 then - pr " || strcasecmp (cmd, \"%s\") == 0"...
2016 Feb 24
3
[PATCH 1/3] src: generate code for printing contents of structs
Extend the generator to generate a source (and the header for it) with functions that print the content of a guestfs struct. The code is modelled after the code for it in fish.ml, although made a bit more generic (destination FILE*, line separator) so it can be used also in the library, when tracing. This just introduces the new code and builds it as part of the helper libutils.la. ---
2016 Jul 22
1
[PATCH] static const char *str -> static const char str
...nst char lvm_%s_cols[] = \"%s\";\n" typ (String.concat "," (List.map fst cols)); pr "\n"; diff --git a/generator/fish.ml b/generator/fish.ml index 980f55f..cc869d3 100644 --- a/generator/fish.ml +++ b/generator/fish.ml @@ -107,7 +107,7 @@ let generate_fish_cmds () = pr "#include \"cmds-gperf.h\"\n"; pr "\n"; pr "/* Valid suffixes allowed for numbers. See Gnulib xstrtol function. */\n"; - pr "static const char *xstrtol_suffixes = \"0kKMGTPEZY\";\n"; + pr "static const char xstrto...
2013 Feb 04
1
[PATCH] generator: Add visibility to action struct
...+let fish_functions_and_commands_sorted = + List.sort action_compare (fish_functions_sorted @ fish_commands) + let doc_opttype_of = function | OBool n -> "true|false" | OInt n @@ -47,13 +50,6 @@ let get_aliases { fish_alias = fish_alias; non_c_aliases = non_c_aliases } = let generate_fish_cmds () = generate_header CStyle GPLv2plus; - let all_functions = - List.filter (fun { in_fish = b } -> b) all_functions in - let all_functions_sorted = - List.filter (fun { in_fish = b } -> b) all_functions_sorted in - - let all_functions_and_fish_commands_sorted = - List.sort a...
2012 Jan 09
1
[PATCH 1/2] generator: Rename java_structs to camel_structs to better reflect their purpose
This map was originally included just for the java bindings, but is generally useful to any binding which uses camel case by requirement or convention. --- generator/generator_haskell.ml | 4 ++-- generator/generator_java.ml | 10 +++++----- generator/generator_main.ml | 2 +- generator/generator_structs.ml | 12 +++++------- generator/generator_structs.mli | 8 ++++---- 5