Task #61630

Output dashed name for missing command arguments on CLI

Added by Mathias Brodala almost 5 years ago. Updated 12 months ago.

Status:
Closed
Priority:
Should have
Category:
Extbase
Target version:
Start date:
2014-09-16
Due date:
% Done:

100%

TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

If a command controller argument like "sayHelloTo" is not passed on CLI execution, an error message like this is shown:

Required argument "sayHelloTo" is not set.

Enter "./typo3/cli_dispatch.phpsh extbase help" for an overview of all available commands
or "./typo3/cli_dispatch.phpsh extbase help <command identifier>" for a detailed description of the corresponding command.

Even though the help command clarifies everything, it would be useful, if the error message did output --say-hello-to instead of sayHelloTo. This way one does not even have to look up the help.

command-argument-dashed.patch View - Show dashed command argument name (1.42 KB) Mathias Brodala, 2014-09-16 11:41

Associated revisions

Revision dcf2e68b (diff)
Added by Mathias Brodala almost 5 years ago

[BUGFIX] Output dashed name for missing CLI arguments

This changes the command argument name outputted on errors from variable
naming to dashed notation as used on the CLI.

Resolves: #61630
Releases: 6.2, master
Change-Id: Ie41c90c056505df859aec3ee306718c874dd8a05
Reviewed-on: http://review.typo3.org/34425
Reviewed-by: Helmut Hummel <>
Tested-by: Helmut Hummel <>
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

Revision 48f3fd9e (diff)
Added by Mathias Brodala almost 5 years ago

[BUGFIX] Output dashed name for missing CLI arguments

This changes the command argument name outputted on errors from variable
naming to dashed notation as used on the CLI.

Resolves: #61630
Releases: 6.2, master
Change-Id: Ie41c90c056505df859aec3ee306718c874dd8a05
Reviewed-on: http://review.typo3.org/34449
Reviewed-by: Helmut Hummel <>
Tested-by: Markus Klein <>

History

#1 Updated by Gerrit Code Review almost 5 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/34425

#2 Updated by Gerrit Code Review almost 5 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/34425

#3 Updated by Helmut Hummel almost 5 years ago

  • Status changed from Under Review to Rejected

Thanks for the report and your efforts.
However it unfortunately does not fit in the planned changes of command controllers which will be integrated for 7LTS

You not always need to specify the dashed name at all. most of the time you can just pass arguments without names.
Besides that, I like to include the change from Flow which uses Symfony console, where instead of an exception to be thrown, the user can directly enter the required argument.
(all this is already implemented in typo3_console which will end up in the core in some release but not 7.0 any more)

#4 Updated by Helmut Hummel almost 5 years ago

To explain a bit more I take your example:

$ ./typo3/cli_dispatch.phpsh extbase message:greet
Required argument "sayHelloTo" is not set
$

Then you can provide the missing argument just like that to make it work:

$ ./typo3/cli_dispatch.phpsh extbase message:greet Helmut
Hello Helmut
$

#5 Updated by Mathias Brodala almost 5 years ago

I get what you mean. ;-) See my comment on the review server.

#6 Updated by Gerrit Code Review almost 5 years ago

  • Status changed from Rejected to Under Review

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/34425

#7 Updated by Gerrit Code Review almost 5 years ago

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/34449

#8 Updated by Mathias Brodala almost 5 years ago

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

#9 Updated by Gerrit Code Review almost 5 years ago

  • Status changed from Resolved to Under Review

Patch set 2 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/34449

#10 Updated by Gerrit Code Review almost 5 years ago

Patch set 3 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/34449

#11 Updated by Mathias Brodala almost 5 years ago

  • Status changed from Under Review to Resolved

#12 Updated by Benni Mack 12 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF