help
. For example, to see help of serve
command you can run:Command
class:-
or --
).name
with a description:self.argument(arg_name)
--force
can have a short name --f
.iterations
and force
with a description:force
argument but not for the iterations
arguments=
suffix:iterations
, the user should provide a value.=?
instead.={default}
:self.option(arg_name)
self.info("Info Message")
: will output a message in greenself.warning("Warning Message")
: will output a message in yellowself.error("Error Message")
: will output a message in bold redself.comment("Comment Message")
: will output a message in light blueCommand
class is inheriting Cleo Command
class so you should be able to use all Cleo features when creating commands.add()
method takes one or multiple commands:python craft
you will now see the command you added.