mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-15 04:05:11 +01:00
parent
10be2c12ab
commit
9d513beeca
@ -2708,8 +2708,10 @@ g_option_context_get_description (GOptionContext *context)
|
|||||||
/**
|
/**
|
||||||
* g_option_context_parse_strv:
|
* g_option_context_parse_strv:
|
||||||
* @context: a #GOptionContext
|
* @context: a #GOptionContext
|
||||||
* @arguments: (inout) (array zero-terminated=1): a pointer to the
|
* @arguments: (inout) (array null-terminated=1) (optional): a pointer
|
||||||
* command line arguments (which must be in UTF-8 on Windows)
|
* to the command line arguments (which must be in UTF-8 on Windows).
|
||||||
|
* Starting with GLib 2.62, @arguments can be %NULL, which matches
|
||||||
|
* g_option_context_parse().
|
||||||
* @error: a return location for errors
|
* @error: a return location for errors
|
||||||
*
|
*
|
||||||
* Parses the command line arguments.
|
* Parses the command line arguments.
|
||||||
@ -2743,7 +2745,7 @@ g_option_context_parse_strv (GOptionContext *context,
|
|||||||
gint argc;
|
gint argc;
|
||||||
|
|
||||||
context->strv_mode = TRUE;
|
context->strv_mode = TRUE;
|
||||||
argc = g_strv_length (*arguments);
|
argc = arguments && *arguments ? g_strv_length (*arguments) : 0;
|
||||||
success = g_option_context_parse (context, &argc, arguments, error);
|
success = g_option_context_parse (context, &argc, arguments, error);
|
||||||
context->strv_mode = FALSE;
|
context->strv_mode = FALSE;
|
||||||
|
|
||||||
|
@ -1912,6 +1912,11 @@ missing_arg_test (void)
|
|||||||
g_strfreev (argv_copy);
|
g_strfreev (argv_copy);
|
||||||
g_free (argv);
|
g_free (argv);
|
||||||
g_option_context_free (context);
|
g_option_context_free (context);
|
||||||
|
|
||||||
|
/* Checking g_option_context_parse_strv on NULL args */
|
||||||
|
context = g_option_context_new (NULL);
|
||||||
|
g_assert_true (g_option_context_parse_strv (context, NULL, NULL));
|
||||||
|
g_option_context_free (context);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gchar *test_arg;
|
static gchar *test_arg;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user