--- eject/eject.c~ 2007-06-28 19:39:46 +0400 +++ eject/eject.c 2007-06-28 19:43:59 +0400 @@ -151,10 +151,10 @@ static const char *partitionDevice[] = { /* Display command usage on standard error and exit. */ -static void usage() +static void usage(FILE *stream) { // perror(_("%s: device is `%s'\n")); - fprintf(stderr,_( + fprintf(stream,_( "Eject version %s by Jeff Tranter (tranter@pobox.com)\n" "Usage:\n" " eject -h -- display command usage and exit\n" @@ -185,7 +185,7 @@ static void usage() ) , version); #ifdef GETOPTLONG - fprintf(stderr,_( + fprintf(stream,_( "Long options:\n" " -h --help -v --verbose -d --default\n" " -a --auto -c --changerslot -t --trayclose -x --cdspeed\n" @@ -209,7 +209,6 @@ static void usage() "If omitted, name defaults to `%s'.\n" "By default tries -r, -s, -f, and -q in order until success.\n"), DEFAULTDEVICE); - exit(1); } @@ -296,7 +295,7 @@ static void parse_args(int argc, char ** f_option = 1; break; case 'h': - usage(); + usage(stdout); exit(0); break; case 'm': @@ -334,6 +333,7 @@ static void parse_args(int argc, char ** exit(0); break; case '?': + usage(stderr); exit(1); break; }