Code cleanup

This commit is contained in:
Pierre Pronchery 2014-07-18 22:16:37 +02:00
parent 53230c46af
commit 25e1b4059c

View File

@ -31,6 +31,10 @@
# include <gtk/gtkx.h> # include <gtk/gtkx.h>
#endif #endif
#ifndef PROGNAME
# define PROGNAME "progress"
#endif
/* types */ /* types */
typedef struct _Prefs typedef struct _Prefs
@ -273,7 +277,7 @@ static int _error_do(Progress * progress, char const * message,
progress->ret = ret; progress->ret = ret;
if(ret < 0) if(ret < 0)
{ {
fputs("progress: ", stderr); fputs(PROGNAME ": ", stderr);
perror(message); perror(message);
return -ret; return -ret;
} }
@ -600,9 +604,9 @@ static void _timeout_remaining(Progress * progress, guint64 rate)
/* usage */ /* usage */
static int _usage(void) static int _usage(void)
{ {
fputs("Usage: progress [-x][-ez][-b buffer size][-f file][-l length]" fputs("Usage: " PROGNAME " [-x][-ez][-b buffer size][-f file][-l length]"
"[-p prefix]\n" "[-p prefix]\n"
" [-t title] cmd [args...]\n" " [-t title] command [args...]\n"
" -e Ignored (for compatibility)\n" " -e Ignored (for compatibility)\n"
" -x Start in embedded mode\n", stderr); " -x Start in embedded mode\n", stderr);
return 1; return 1;