Search

Showing 7 of 1,216 result(s)

/blog/2016/12/01/laravel-artisan-command-input-and-command-signatures#content-command-options

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...

/blog/2016/12/01/laravel-artisan-command-input-and-command-signatures#content-command-option-default-values

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...

/blog/2016/12/01/laravel-artisan-command-input-and-command-signatures#content-adding-descriptions-to-command-options

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...

/blog/2016/12/01/laravel-artisan-command-input-and-command-signatures#content-command-option-shortcuts

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...

/blog/2016/12/01/laravel-artisan-command-input-and-command-signatures#content-using-command-options-as-flags

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...

/blog/2016/12/01/laravel-artisan-command-input-and-command-signatures#content-making-input-arguments-optional

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,...

/blog/2016/12/07/laravel-artisan-custom-styles-custom-progress-bar-styles#content-setbarcharacterchar

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....