[TYPO3-team-core-v5] CLI support for controllers in sub-packages
Tim Eilers
tim.eilers at web.de
Wed Sep 24 19:19:19 CEST 2008
Hi Karsten,
since my daily work consists of 80% typing on Linux and AIX shells i
would like to tell you my general thoughts:
If you really would like to make as unixoid as possible it is a bit
difficult.
At first commonly options are mostly before any command on a unixoid
command line programm, so i would change the order.
Next thing is that i dont really like this distinguish part "--". At
last using space separation for contigous parts is also problematic.
Let me suggest you a completely other idea:
First options, then command colon-seperated. Arguments = optional option
and comma-seperated.
That would lead to this:
php index.php [<options>] <command>
With f.e. option -a (long --arguments) for arguments.
Using your example it would lead to:
php index.php typo3cr:admin:setup:default
and with some argument:
php index.php -a answerToEverything=42 typo3cr:admin:setup:default
and some more
php index.php -a answerToEverything=42,iLikeCLI=TRUE
typo3cr:admin:setup:default
(line break caused by my mail client)
or if the colon idea is bad:
php index.php -a answerToEverything=42 typo3cr admin setup default
It is just an idea and you could use your initial idea, but i would at
least change options and command position since that is more common on
unixoid systems.
Also i would recommend you to change the cli default view (when calling
only "php index.php") to some short help output (as you would expect it
from unixoid commands).
Cheers,
Tim.
Karsten Dambekalns schrieb:
> Hi.
>
> I brainstormed together with Andreas in a little chat session. Here's
> the result.
>
> -----
>
> The general syntax is
> php index.php <command> [<options>] [--] [<arguments>]
>
> <command> is mandatory, <options> and <arguments> are optional.
> It follows what is commonly accpeted on unixoid systems for CLI programs.
>
>
> <command> is defined as
> <package> [<sub1..N>] [<controller>] [<action>]
>
> First part is always the package, then last two are always controller
> and action. if anything is in between, that are sub packages. Example:
> typo3cr admin setup default
> would call the "setup" controller's "default" action in the subpackage
> "admin" of the package "TYPO3CR"
>
> The package key may be used alone, then the default controller and
> action are assumed.
>
>
> [options] are either short- or long-style
> -a HURZ --b BLAH
>
>
> [arguments] can follow and will be handed over to the called controller.
> To distinguish between [command] and [arguments] in cases where no
> [options] are given, the seperator "--" must be used. If options are
> used, it is optional.
>
> -----
>
> What do you think?
>
> Regards,
> Karsten
More information about the TYPO3-team-core-v5
mailing list