Feature #27563

Implement simple argument support for CommandController

Added by Robert Lemke about 4 years ago. Updated about 4 years ago.

Status:Resolved Start date:2011-06-20
Priority:Should have Due date:
Assigned To:- % Done:

100%

Category:MVC
Target version:TYPO3 Flow Base Distribution - 1.0 beta 1
PHP Version: Complexity:
Has patch:

Description

Currently arguments can only be passed to a CommandController by specifying the argument name:

./flow3_dev flow3:package:create --package-key MyPackage

For cases like the one above it would be nice to be able to specify the argument without a name:

./flow3_dev flow3:package:create MyPackage

On the implementation side this could work as follows:

  • if no argument name is specified, the argument order must match the order of the command function's arguments
  • if an argument without name is specified, all non-optional arguments must be specified without a name in the correct order – mixing non-optional arguments with and without specifying the name should not be possible (to avoid confusion)
  • to make things easier we can (should) make the rule that options (ie. named arguments which are optional in the function's signature) must be specified before any unnamed argument (e.g flow3:package:create --description "My Package" --make-it-extra-cool MyPackage)

Related issues

related to TYPO3.Flow - Bug #27820: CLI arguments are not working for camelCased commands Resolved 2011-07-03

Associated revisions

Revision cb489cc5
Added by Robert Lemke about 4 years ago

[FEATURE] Shorthand command commands and arguments

This allows to type just controllername:commandname if this uniquely
identifies a package / controller /command method in the system.
Hence you can just type ./flow3 kickstart:package Foo.Bar

A second feature added is that named (required) arguments can be
specified without the argument name (like the package key Foo.Bar
above) as long as all required arguments are specified that way and
in the correct order. Optional arguments must always be named and
specified before the named arguments.

The CLI request now also provides a getExceedingArguments() method and
this fixes a small bug related to camel cased controller names.

Change-Id: I89ab55f99c0ea35a66167b485b62238034e10bc7
Resolves: #27563
Resolves: #27820

History

#1 Updated by Mr. Hudson about 4 years ago

  • Status changed from New to Under Review

Patch set 1 of change I89ab55f99c0ea35a66167b485b62238034e10bc7 has been pushed to the review server.
It is available at http://review.typo3.org/3124

#2 Updated by Robert Lemke about 4 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF