Re: Overriding command line options

From: Axel Naumann <axel-naumann_at_gmx.de>
Date: Fri, 11 Feb 2005 18:01:53 -0600


Hi Jeff,
simply create your own TApplication derived class, and overload void TApplication::GetOptions(Int_t *argc, char **argv). O, and don't forget to instantiate your new class in your main(), instead of TApplication ;-) Axel.

Jeff Levesque wrote:
> Hello ROOTers,
>
> I'm writing a stand-alone ROOT program, and am having a problem making
> my own usage help. If I try to implement a help option (with a "-?",
> "-h", or "--help" command line option), the ROOT usage help will show up
> instead. This also happens with any argument I give that begins with
> "-h". For instance, naming my program "main" and running it with:
>
> main -hello=10
>
> will show the ROOT message:
> -------------------------------"
> Usage: main [-l] [-b] [-n] [-q] [dir] [file1.C ... fileN.C]
> Options:
> -b : run in batch mode without graphics
> -n : do not execute logon and logoff macros as specified in .rootrc
> -q : exit after processing command line macro files
> -l : do not show splash screen
> dir : if dir is a valid directory cd to it before executing
>
> -? : print usage
> -h : print usage
> --help : print usage
> -config : print ./configure options
> "--------------------------
> instead of displaying the "-h____" argument I implement in my program.
> Is there any way I can override the given root command line options for
> my stand-alone program? I'm running ROOT version 4.02/00 with cygwin on
> a WinXP machine. My current compiling command is:
>
> g++ -o main main.cpp `root-config --libs`
>
> Thank you,
> Jeff Levesque
>
Received on Sat Feb 12 2005 - 01:02:20 MET

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:04 MET