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

Tim Eilers tim.eilers at web.de
Thu Sep 25 20:38:48 CEST 2008


Hi Karsten,

Karsten Dambekalns schrieb:
> Hi Bastian.
> 
> Bastian Waidelich wrote:
>> you were too fast for me at least.. I didn't really get the difference
>> between options and arguments. Do we need to separate them at all?
> 
> Yes, we do.

i prepared an answer to the other branch of the thread, but i noticed
that i first have to learn, before i answer.

> Consider some command that accepts a bunch of files as input. You do
> probably not want to add one option per file. And adding more than one
> value to one option is also bad style IMHO.
> 
> So, let's use a lame example: Assume we have ls (dir for you ;) as part
> of some FLOW3 shell-emulator. How do you write this in a FLOW3 call:
>  ls -G *.jpg
> (Keep in mind the wildcard is expanded by the shell, so FLOW3 receives a
> list of arguments, not the literal "*.jpg"!)
> 
> I'd expect this:
>  php index.php shell file ls -G -- *.jpg
> (I admit the -- is ugly here, but we don't know if -G accepts a value)

That exactly is the point which i do not understand. How does FLOW3 know
that "*.jpg" belongs to "subject"?
Is that any default routing?
What happens when i have two different arguments which both could have
files as value?

With your below examples it would be --foo *.jpg --bar *.png
or --foo one.jpg --foo2 two.jpg --bar one.png --bar2 two.png
But what would it be with your above example?
...-G -- *.jpg *.png
?

> The alternative would be to add some option, say "subject":
>  php index.php shell file ls -G --subject *.jpg
> 
> Now you'd need to explode(' ', $subject). Bah. Or, even worse:
>  php index.php shell file ls -G --subject one.jpg --subject2 two.jpg ...
> Argh, right?
> 
> Anyway, I hope at least I could explain the difference between options
> and arguments.[1]
> 
> Karsten
> 
> [1] Another way: options is what you specify like "\b" in DOS, arguments
> is what you simply gibe to your command.
> [2] Yet another way: options is "how", arguments is "with what" - more
> or less.


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