[TYPO3-team-core-v5] CLI support for controllers in sub-packages

Karsten Dambekalns karsten at typo3.org
Thu Sep 25 12:11:26 CEST 2008


Hi Tim, everyone.

Tim Eilers wrote:
> since my daily work consists of 80% typing on Linux and AIX shells i
> would like to tell you my general thoughts:

Well, I have some years of administering Linux behind me as well. :)

> At first commonly options are mostly before any command on a unixoid
> command line programm, so i would change the order.

Not necessarily. Look at "port", "svn", "cvs", ... At least I remember 
some (of those and others) to differentiate between options given to the 
main command and the command given to the command given to it. Hm, was 
that understandable? Anyway, see below for more on this.

> Next thing is that i dont really like this distinguish part "--".

Well, but in widespread use. An alternative would be to only accept 
values if written this way:
  --option=value
i.e. using = and no whitespace. Currently the code accepts also a bunch 
of other ways:
  --option =value
  --option = value
  --option value

If we switch to using a different command seperator (see below) and 
forbid spaces between options and possible values we can leave out the 
"--" once and for all.

> At last using space separation for contigous parts is also problematic.

Why?

> Let me suggest you a completely other idea:
> First options, then command colon-seperated. Arguments = optional option
> and comma-seperated.

a) But the options are given to the command, not to FLOW3 itself.
b) Arguments are frequently coming from expansion done by the shell - 
how do you educate it to produce a comma-seperated list?

> That would lead to this:
> 
> php index.php [<options>] <command>

Fine, but I'd expect this to be options to FLOW3. We could of course do 
something like this, e.g. to solve our 
persistence-needs-to-be-off-for-typo3cr-setup-problem:
  php index.php --enable-persistence=0 typo3cr setup setup --dsn=...

So, no optional command, options before the command are FLOW3 settings. 
To distinguish between FLOW3, Settings, Package one could add a prefix 
(--flow3:enable-persistence=0).

> php index.php typo3cr:admin:setup:default

Ok, then let's use :: right away, just give the real controller name. 
The last part is split and used as action. What do you think?

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

Absolutely. There could be some "master help" command, so that every CLI 
call has some helpful output, stating "this controller doesn't support 
CLI" or give some list of possible arguments.


Karsten


More information about the TYPO3-team-core-v5 mailing list