mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-13 15:56:23 +01:00
Merge branch 'wip/oholy/gio-tool-arguments' into 'master'
Fix some inconsistencies regarding arguments in gio-tool See merge request GNOME/glib!18
This commit is contained in:
commit
2b4c962541
@ -130,7 +130,7 @@ handle_cat (int argc, char *argv[], gboolean do_help)
|
||||
|
||||
g_set_prgname ("gio cat");
|
||||
/* Translators: commandline placeholder */
|
||||
param = g_strdup_printf ("%s...", _("LOCATION"));
|
||||
param = g_strdup_printf ("%s…", _("LOCATION"));
|
||||
context = g_option_context_new (param);
|
||||
g_free (param);
|
||||
g_option_context_set_help_enabled (context, FALSE);
|
||||
|
@ -95,7 +95,7 @@ handle_copy (int argc, char *argv[], gboolean do_help)
|
||||
g_set_prgname ("gio copy");
|
||||
|
||||
/* Translators: commandline placeholder */
|
||||
param = g_strdup_printf ("%s... %s", _("SOURCE"), _("DESTINATION"));
|
||||
param = g_strdup_printf ("%s… %s", _("SOURCE"), _("DESTINATION"));
|
||||
context = g_option_context_new (param);
|
||||
g_free (param);
|
||||
g_option_context_set_help_enabled (context, FALSE);
|
||||
|
@ -279,7 +279,7 @@ handle_info (int argc, char *argv[], gboolean do_help)
|
||||
g_set_prgname ("gio info");
|
||||
|
||||
/* Translators: commandline placeholder */
|
||||
param = g_strdup_printf ("%s...", _("LOCATION"));
|
||||
param = g_strdup_printf ("%s…", _("LOCATION"));
|
||||
context = g_option_context_new (param);
|
||||
g_free (param);
|
||||
g_option_context_set_help_enabled (context, FALSE);
|
||||
|
@ -162,7 +162,7 @@ handle_list (int argc, char *argv[], gboolean do_help)
|
||||
g_set_prgname ("gio list");
|
||||
|
||||
/* Translators: commandline placeholder */
|
||||
param = g_strdup_printf ("[%s...]", _("LOCATION"));
|
||||
param = g_strdup_printf ("[%s…]", _("LOCATION"));
|
||||
context = g_option_context_new (param);
|
||||
g_free (param);
|
||||
g_option_context_set_help_enabled (context, FALSE);
|
||||
|
@ -45,7 +45,7 @@ handle_mkdir (int argc, char *argv[], gboolean do_help)
|
||||
g_set_prgname ("gio mkdir");
|
||||
|
||||
/* Translators: commandline placeholder */
|
||||
param = g_strdup_printf ("%s...", _("LOCATION"));
|
||||
param = g_strdup_printf ("%s…", _("LOCATION"));
|
||||
context = g_option_context_new (param);
|
||||
g_free (param);
|
||||
g_option_context_set_help_enabled (context, FALSE);
|
||||
|
@ -200,7 +200,7 @@ handle_monitor (int argc, gchar *argv[], gboolean do_help)
|
||||
g_set_prgname ("gio monitor");
|
||||
|
||||
/* Translators: commandline placeholder */
|
||||
param = g_strdup_printf ("[%s...]", _("LOCATION"));
|
||||
param = g_strdup_printf ("%s…", _("LOCATION"));
|
||||
context = g_option_context_new (param);
|
||||
g_free (param);
|
||||
g_option_context_set_help_enabled (context, FALSE);
|
||||
|
@ -1138,7 +1138,7 @@ handle_mount (int argc, char *argv[], gboolean do_help)
|
||||
g_set_prgname ("gio mount");
|
||||
|
||||
/* Translators: commandline placeholder */
|
||||
param = g_strdup_printf ("[%s...]", _("LOCATION"));
|
||||
param = g_strdup_printf ("[%s…]", _("LOCATION"));
|
||||
context = g_option_context_new (param);
|
||||
g_free (param);
|
||||
g_option_context_set_help_enabled (context, FALSE);
|
||||
@ -1160,8 +1160,6 @@ handle_mount (int argc, char *argv[], gboolean do_help)
|
||||
return 1;
|
||||
}
|
||||
|
||||
g_option_context_free (context);
|
||||
|
||||
main_loop = g_main_loop_new (NULL, FALSE);
|
||||
|
||||
if (mount_list)
|
||||
@ -1186,6 +1184,14 @@ handle_mount (int argc, char *argv[], gboolean do_help)
|
||||
g_object_unref (file);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
show_help (context, _("No locations given"));
|
||||
g_option_context_free (context);
|
||||
return 1;
|
||||
}
|
||||
|
||||
g_option_context_free (context);
|
||||
|
||||
if (outstanding_mounts > 0)
|
||||
g_main_loop_run (main_loop);
|
||||
|
@ -91,7 +91,7 @@ handle_move (int argc, char *argv[], gboolean do_help)
|
||||
g_set_prgname ("gio move");
|
||||
|
||||
/* Translators: commandline placeholder */
|
||||
param = g_strdup_printf ("%s... %s", _("SOURCE"), _("DESTINATION"));
|
||||
param = g_strdup_printf ("%s… %s", _("SOURCE"), _("DESTINATION"));
|
||||
context = g_option_context_new (param);
|
||||
g_free (param);
|
||||
g_option_context_set_help_enabled (context, FALSE);
|
||||
|
@ -110,7 +110,7 @@ handle_open (int argc, char *argv[], gboolean do_help)
|
||||
g_set_prgname ("gio open");
|
||||
|
||||
/* Translators: commandline placeholder */
|
||||
param = g_strdup_printf ("%s...", _("LOCATION"));
|
||||
param = g_strdup_printf ("%s…", _("LOCATION"));
|
||||
context = g_option_context_new (param);
|
||||
g_free (param);
|
||||
g_option_context_set_help_enabled (context, FALSE);
|
||||
|
@ -45,7 +45,7 @@ handle_remove (int argc, char *argv[], gboolean do_help)
|
||||
g_set_prgname ("gio remove");
|
||||
|
||||
/* Translators: commandline placeholder */
|
||||
param = g_strdup_printf ("%s...", _("LOCATION"));
|
||||
param = g_strdup_printf ("%s…", _("LOCATION"));
|
||||
context = g_option_context_new (param);
|
||||
g_free (param);
|
||||
g_option_context_set_help_enabled (context, FALSE);
|
||||
|
@ -86,7 +86,7 @@ handle_set (int argc, char *argv[], gboolean do_help)
|
||||
g_set_prgname ("gio set");
|
||||
|
||||
/* Translators: commandline placeholder */
|
||||
param = g_strdup_printf ("%s %s %s...", _("LOCATION"), _("ATTRIBUTE"), _("VALUE"));
|
||||
param = g_strdup_printf ("%s %s %s…", _("LOCATION"), _("ATTRIBUTE"), _("VALUE"));
|
||||
context = g_option_context_new (param);
|
||||
g_free (param);
|
||||
g_option_context_set_help_enabled (context, FALSE);
|
||||
|
@ -78,7 +78,7 @@ handle_trash (int argc, char *argv[], gboolean do_help)
|
||||
g_set_prgname ("gio trash");
|
||||
|
||||
/* Translators: commandline placeholder */
|
||||
param = g_strdup_printf ("[%s...]", _("LOCATION"));
|
||||
param = g_strdup_printf ("[%s…]", _("LOCATION"));
|
||||
context = g_option_context_new (param);
|
||||
g_free (param);
|
||||
g_option_context_set_help_enabled (context, FALSE);
|
||||
@ -101,8 +101,6 @@ handle_trash (int argc, char *argv[], gboolean do_help)
|
||||
return 1;
|
||||
}
|
||||
|
||||
g_option_context_free (context);
|
||||
|
||||
if (argc > 1)
|
||||
{
|
||||
int i;
|
||||
@ -133,5 +131,14 @@ handle_trash (int argc, char *argv[], gboolean do_help)
|
||||
g_object_unref (file);
|
||||
}
|
||||
|
||||
if (argc == 1 && !empty)
|
||||
{
|
||||
show_help (context, _("No locations given"));
|
||||
g_option_context_free (context);
|
||||
return 1;
|
||||
}
|
||||
|
||||
g_option_context_free (context);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
@ -236,7 +236,7 @@ handle_tree (int argc, char *argv[], gboolean do_help)
|
||||
g_set_prgname ("gio tree");
|
||||
|
||||
/* Translators: commandline placeholder */
|
||||
param = g_strdup_printf ("[%s...]", _("LOCATION"));
|
||||
param = g_strdup_printf ("[%s…]", _("LOCATION"));
|
||||
context = g_option_context_new (param);
|
||||
g_free (param);
|
||||
g_option_context_set_help_enabled (context, FALSE);
|
||||
|
@ -221,7 +221,7 @@ static void
|
||||
usage (void)
|
||||
{
|
||||
g_printerr ("%s\n", _("Usage:"));
|
||||
g_printerr (" gio %s %s\n", _("COMMAND"), _("[ARGS...]"));
|
||||
g_printerr (" gio %s %s\n", _("COMMAND"), _("[ARGS…]"));
|
||||
g_printerr ("\n");
|
||||
g_printerr ("%s\n", _("Commands:"));
|
||||
g_printerr (" help %s\n", _("Print help"));
|
||||
|
Loading…
Reference in New Issue
Block a user