agent-no-start with or without arg?

John Sanda jsanda at redhat.com
Wed Jun 12 01:09:35 UTC 2013


On Jun 11, 2013, at 8:35 PM, John Mazzitelli <mazz at redhat.com> wrote:

> I added the "--agent-no-start" option to rhqctl a few days ago. It takes true or false as an argument (the default is false).
> 
> I did this because I tend to prefer options whose two boolean values can be specified explicitly (true or false). Without accepting a value, there is no way to explicitly say you want the agent to start (the only way would be to not specify --agent-no-start).
> 
> So we have: 
> 
> --agent-no-start=false means to start the agent after being installed (this is the default)
> --agent-no-start=true means don't start.
> 
> However, I sense this might be confusing.
> 
> Should I just make this a non-arg option? So to not have the agent start, you specify --agent-no-start. To have the agent start (which is the default behavior) you don't specify it at all.
> 
> We are using org.apache.commons.cli.Options, I don't think you can tell it to have an optional argument (like you can with gnu getopt). If you CAN do this, let me know.

See Option.setRequired(boolean)

> 
> What say you? If we want to change it, I want to do so now before release.

I generally think things are a bit more clear when stated in the affirmative. What about --start-agent where the option does take an argument?


More information about the rhq-devel mailing list