Bug #28306

Optional command line argument is ignored

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

Status:
Resolved
Priority:
Must have
Category:
MVC
Start date:
2011-07-19
Due date:
% Done:

100%

PHP Version:
Has patch:
Complexity:

Description

Consider the following command as part of a command controller:

public function importCommand($packageKey = NULL) {
   var_dump($packageKey);
}

Call the command with

./flow3 foo:import MyPackage.Key

Expected result is MyPackage.Key, but actual result is NULL

Associated revisions

Revision eba466a3 (diff)
Added by Bastian Waidelich about 8 years ago

[!!!][TASK] Some improvements to CLI handling

- Fixes optional argument handling
- Improves readability of help index
- Help for single commands (usage: "./flow3 help <command>")
- Adds convenience methods output(), outputLine() and quit() to
CommandController as wrapper for response object
- Adjust existing commands to the new syntax

This is a breaking change because $this->response->appendContent() will no longer append
a line break. Use $this->outputLine() instead.

Change-Id: Ieb10c861b5671536ead54a2e3b74aa96584f0abd
Related: #28231
Resolves: #28306

History

#1 Updated by Bastian Waidelich about 8 years ago

  • Status changed from New to Accepted
  • Assignee set to Bastian Waidelich

#2 Updated by Robert Lemke about 8 years ago

Another symptom of this bug is the kickstart:action controller command:

The second argument "controller name" is optional and its default is "Standard". Currently it is not possible to kickstart any other than a Standard controller, no matter what name is passed as the second argument.

#3 Updated by Robert Lemke about 8 years ago

  • Subject changed from Optional command line augment is ignored to Optional command line argument is ignored

#4 Updated by Karsten Dambekalns about 8 years ago

Just tested the kickstart:actioncontroller example and that worked fine... Seems fixed already.

#5 Updated by Robert Lemke about 8 years ago

  • Status changed from Accepted to Resolved
  • % Done changed from 0 to 100

yes, that has been resolved

Also available in: Atom PDF