girepository: Split arguments of gi_repository_dump()

Accepting two filenames as a string comma-separated string seems like a
layering violation: this is a public API which could be used in places
other than directly off a set of command line arguments.

Move the command line argument parsing to the command line callback.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3155
This commit is contained in:
Philip Withnall
2023-12-12 22:43:11 +00:00
parent 9b47344f3c
commit f55b18e11e
3 changed files with 31 additions and 22 deletions

View File

@@ -1740,8 +1740,11 @@ gi_repository_introspect_cb (const char *option_name,
GError **error)
{
GError *tmp_error = NULL;
gboolean ret = gi_repository_dump (value, &tmp_error);
if (!ret)
char **args;
args = g_strsplit (value, ",", 2);
if (!gi_repository_dump (args[0], args[1], &tmp_error))
{
g_error ("Failed to extract GType data: %s",
tmp_error->message);