Showing 7 of 1,216 result(s)
So far the discussion has focused on command parameters. Options are also a useful way for users to provide input and control the execution of commands. Defining commands is similar to defining command parameters with the exception that option...
It is also possible to specify a default value for the options. The following signature is similar to the previous one, except that the --age option will have a default value of 0 that will be used if the end user does not specify an age: The new...
You can see from the above output that the command accepts an --age option and it has a default value of 0 . Although --age is fairly descriptive, it would be nice to give the option a good description. The process to add a description to options...
In practice, options can become long to type for the end user; this is partly a side effect of having to type the -- prefix along with the option name. To help alleviate this, options support shortcuts. In the previous example the --age option was...
So far the examples of command options make the assumption that the user is required to enter a value for a command option. Options can be used as flags or switches to change the execution behavior of the command. To have an option behave like a...
So far we've looked at defining command arguments with either required or default values. Another useful thing is to make command arguments optional . By default, an argument with a default value is categorized as an optional argument. However,...
The setBarCharacter method is used to change the which character is used to represent which steps have already been completed. On Windows systems this character is = by default. The following examples demonstrate how to change the bar character....