[Insight-users] How to get whether an option has been set using metaCommand?

Julien Jomier julien.jomier at kitware.com
Mon Jun 18 10:43:48 EDT 2007


Hi Kurt,

You can use the GetOptionWasSet("Write") command.

Julien

kurt Zhao wrote:
> Hi,
> 
> If I use the example below:
> ./example input.mha –w 2 output.mha
> This will be coded as:
> MetaCommand command;
> command.SetOption("Write","w",false,"writes the current image to the
> designated file with a type");
> command.AddOptionField("Write","filename",MetaCommand::STRING,true);
> command.AddOptionField("Write","Type",MetaCommand::INT,false,"1");
> //by default type=1
> command.AddField("infile","infile filename",MetaCommand::STRING,true);
> 
> if I want to also handle ./example input.mha -w 2 output.mha
> ./example input.mha differnetly, how can I know if the caller has set
> the the option -w or not.
> 
> Thanks a lot!
> 
> -Kurt
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 



More information about the Insight-users mailing list