Add tests for the handling of non-option arguments, "--" and

2004-10-29  Matthias Clasen  <mclasen@redhat.com>

	* tests/option-test.c: Add tests for the handling of
	non-option arguments, "--" and G_OPTION_REMAINING.

	* glib/goption.[hc]: #define G_OPTION_REMAINING, which is
	a special long option name, which can be used for an option
	in the main group which collects the non-option arguments.
	It must be of type G_OPTION_ARG_STRING_ARRAY or
	G_OPTION_ARG_FILENAME_ARRAY. If the main group doesn't contain
	an option whose name is G_OPTION_REMAINING, the non-option
	arguments are left behind in argv as before.
This commit is contained in:
Matthias Clasen
2004-10-29 20:19:06 +00:00
committed by Matthias Clasen
parent a0e217e94a
commit a9fa61a13e
8 changed files with 304 additions and 10 deletions

View File

@@ -87,6 +87,8 @@ struct _GOptionEntry
const gchar *arg_description;
};
#define G_OPTION_REMAINING ""
GOptionContext *g_option_context_new (const gchar *parameter_string);
void g_option_context_free (GOptionContext *context);
void g_option_context_set_help_enabled (GOptionContext *context,
@@ -132,9 +134,6 @@ void g_option_group_set_translation_domain (GOptionGroup *group,
const gchar *domain);
G_END_DECLS
#endif /* __G_OPTION_H__ */