summaryrefslogtreecommitdiff
path: root/programs/gvfs-tree.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2012-06-29 13:52:16 -0400
committerMatthias Clasen <mclasen@redhat.com>2012-06-29 13:52:16 -0400
commit1a20e31a1660b1e51efc3a1bb2bb9044af209d3d (patch)
tree671ff0b1db052f2401f5272753592990931dc30a /programs/gvfs-tree.c
parent99051ad3a99fb4db0444362348b7421f2e01b93d (diff)
downloadgvfs-1a20e31a1660b1e51efc3a1bb2bb9044af209d3d.tar.gz
Apply some love to the gvfs utilities
This makes the --help output more consistent across the utilities. - Capitalize parameters - Make summaries full sentences - Shorten some overlong strings - Strip . off option descriptions - Make descriptions of identical options the same - Improve error handling for option parsing Also, do proper gettext setup in all utilities.
Diffstat (limited to 'programs/gvfs-tree.c')
-rw-r--r--programs/gvfs-tree.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/programs/gvfs-tree.c b/programs/gvfs-tree.c
index f235df59..fc678846 100644
--- a/programs/gvfs-tree.c
+++ b/programs/gvfs-tree.c
@@ -34,7 +34,7 @@ static gboolean follow_symlinks = FALSE;
static GOptionEntry entries[] =
{
{ "hidden", 'h', 0, G_OPTION_ARG_NONE, &show_hidden, N_("Show hidden files"), NULL },
- { "follow-symlinks", 'l', 0, G_OPTION_ARG_NONE, &follow_symlinks, N_("Follow symbolic links, mounts and shortcuts like directories"), NULL },
+ { "follow-symlinks", 'l', 0, G_OPTION_ARG_NONE, &follow_symlinks, N_("Follow symbolic links, mounts and shortcuts"), NULL },
};
static gint
@@ -233,25 +233,35 @@ main (int argc, char *argv[])
GError *error;
GOptionContext *context;
GFile *file;
+ gchar *param;
+ gchar *summary;
setlocale (LC_ALL, "");
+ bindtextdomain (GETTEXT_PACKAGE, GVFS_LOCALEDIR);
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+ textdomain (GETTEXT_PACKAGE);
+
g_type_init ();
error = NULL;
- context = g_option_context_new (_("- list contents of directories in a tree-like format"));
+ param = g_strdup_printf ("[%s...]", _("LOCATION"));
+ summary = _("List contents of directories in a tree-like format.");
+
+ context = g_option_context_new (param);
+ g_option_context_set_summary (context, summary);
g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
g_option_context_parse (context, &argc, &argv, &error);
g_option_context_free (context);
+ g_free (param);
if (error != NULL)
{
g_printerr (_("Error parsing commandline options: %s\n"), error->message);
g_printerr ("\n");
- g_printerr (_("Try \"%s --help\" for more information."),
- g_get_prgname ());
+ g_printerr (_("Try \"%s --help\" for more information."), g_get_prgname ());
g_printerr ("\n");
- g_error_free(error);
+ g_error_free (error);
return 1;
}