Added a usage screen to the run utility

This commit is contained in:
Pierre Pronchery 2010-04-22 11:48:08 +00:00
parent 90f8294e7c
commit 354d596db3
2 changed files with 22 additions and 1 deletions

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Panel 0.0.5\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-04-22 13:41+0200\n"
"POT-Creation-Date: 2010-04-22 13:47+0200\n"
"PO-Revision-Date: 2010-04-22 12:45+0200\n"
"Last-Translator: Pierre Pronchery <khorben@defora.org>\n"
"Language-Team: French\n"
@ -70,3 +70,7 @@ msgstr "Erreur"
#: ../src/run.c:318
msgid "Child exited with error code 127"
msgstr "La commande a retourné un code d'erreur 127"
#: ../src/run.c:392
msgid "Usage: run\n"
msgstr "Usage: run\n"

View File

@ -386,15 +386,32 @@ static void _on_run_terminal_toggle(GtkWidget * widget, gpointer data)
}
/* usage */
static int _usage(void)
{
fputs(_("Usage: run\n"), stderr);
return 1;
}
/* main */
int main(int argc, char * argv[])
{
int o;
Run * run;
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
gtk_init(&argc, &argv);
while((o = getopt(argc, argv, "")) != -1)
switch(o)
{
default:
return _usage();
}
if(optind != argc)
return _usage();
if((run = _run_new()) == NULL)
return _run_error(error_get(), 2);
gtk_main();