diff options
author | Andrey Nazarov <skuller@skuller.net> | 2011-05-26 16:18:39 +0400 |
---|---|---|
committer | Andrey Nazarov <skuller@skuller.net> | 2011-05-30 17:58:40 +0400 |
commit | 4884a7c366e068de3f818b6c2eec0ae41f940140 (patch) | |
tree | faef0b8c067c7e6840247b0ef05b88efdbc79d9f /src/sys_unix.c | |
parent | d7bcacd9fb01162c70f5f44ed9bea360c1ad4be4 (diff) |
Don't print version twice on startup.
Also print to stderr when called with ‘--version’ argument.
Diffstat (limited to 'src/sys_unix.c')
-rw-r--r-- | src/sys_unix.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/sys_unix.c b/src/sys_unix.c index a7ffcb7..0db6141 100644 --- a/src/sys_unix.c +++ b/src/sys_unix.c @@ -952,19 +952,18 @@ main int main( int argc, char **argv ) { if( argc > 1 ) { if( !strcmp( argv[1], "-v" ) || !strcmp( argv[1], "--version" ) ) { - printf( APPLICATION " " VERSION " " __DATE__ " " BUILDSTRING " " - CPUSTRING "\n" ); + fprintf( stderr, "%s\n", com_version_string ); return 0; } if( !strcmp( argv[1], "-h" ) || !strcmp( argv[1], "--help" ) ) { - printf( "Usage: %s [+command arguments] [...]\n", argv[0] ); + fprintf( stderr, "Usage: %s [+command arguments] [...]\n", argv[0] ); return 0; } } if( !getuid() || !geteuid() ) { - printf( "You can not run " APPLICATION " as superuser " - "for security reasons!\n" ); + fprintf( stderr, "You can not run " PRODUCT " as superuser " + "for security reasons!\n" ); return 1; } |