Hi all, some trivial patches, rationale is that both -v and -h should print on cout rather than cerr, so you can do: fluxus -h | grep foo
then fluxus -h and -v should return a 0 code, that means there was no error. R.
>From 82b542aba6173b66fe1e0448082ad62bf48adf55 Mon Sep 17 00:00:00 2001 From: Stefano Sabatini <[email protected]> Date: Thu, 4 Jun 2009 00:28:03 +0200 Subject: [PATCH] Prefer cout over cerr --- src/main.cpp | 24 ++++++++++++------------ 1 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 84c4627..38329da 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -214,22 +214,22 @@ int run(Scheme_Env* se, int argc, char *argv[]) { if (!strcmp(argv[arg],"-v")) { - cerr<<"fluxus version: "<<FLUXUS_MAJOR_VERSION<<"."<<FLUXUS_MINOR_VERSION<<endl; + cout<<"fluxus version: "<<FLUXUS_MAJOR_VERSION<<"."<<FLUXUS_MINOR_VERSION<<endl; exit(1); } else if (!strcmp(argv[arg],"-h")) { - cerr<<"fluxus [options] [filename1] [filename2] ..."<<endl; - cerr<<"options:"<<endl; - cerr<<"-h : help"<<endl; - cerr<<"-v : version info"<<endl; - cerr<<"-r filename : record keypresses"<<endl; - cerr<<"-p filename : playback keypresses"<<endl; - cerr<<"-d time : set delta time between frames for keypress playback"<<endl; - cerr<<"-lang language : sets the PLT language to use (may not work)"<<endl; - cerr<<"-fs : startup in fullscreen mode"<<endl; - cerr<<"-hm : hide the mouse pointer on startup"<<endl; - cerr<<"-x : execute and hide script at startup"<<endl; + cout<<"fluxus [options] [filename1] [filename2] ..."<<endl; + cout<<"options:"<<endl; + cout<<"-h : help"<<endl; + cout<<"-v : version info"<<endl; + cout<<"-r filename : record keypresses"<<endl; + cout<<"-p filename : playback keypresses"<<endl; + cout<<"-d time : set delta time between frames for keypress playback"<<endl; + cout<<"-lang language : sets the PLT language to use (may not work)"<<endl; + cout<<"-fs : startup in fullscreen mode"<<endl; + cout<<"-hm : hide the mouse pointer on startup"<<endl; + cout<<"-x : execute and hide script at startup"<<endl; exit(1); } else if (!strcmp(argv[arg],"-r")) -- 1.5.6.5
>From 694dd11ef3bd788c12368ebe20fbecc4fa97a733 Mon Sep 17 00:00:00 2001 From: Stefano Sabatini <[email protected]> Date: Thu, 4 Jun 2009 00:42:20 +0200 Subject: [PATCH] Return 0 rather than 1. --- src/main.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 38329da..7ae1d24 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -215,7 +215,7 @@ int run(Scheme_Env* se, int argc, char *argv[]) if (!strcmp(argv[arg],"-v")) { cout<<"fluxus version: "<<FLUXUS_MAJOR_VERSION<<"."<<FLUXUS_MINOR_VERSION<<endl; - exit(1); + exit(0); } else if (!strcmp(argv[arg],"-h")) { @@ -230,7 +230,7 @@ int run(Scheme_Env* se, int argc, char *argv[]) cout<<"-fs : startup in fullscreen mode"<<endl; cout<<"-hm : hide the mouse pointer on startup"<<endl; cout<<"-x : execute and hide script at startup"<<endl; - exit(1); + exit(0); } else if (!strcmp(argv[arg],"-r")) { -- 1.5.6.5
