Project

General

Profile

Actions

Bug #59843

closed

Fix the help message of CLI

Added by Stefano Kowalke almost 10 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
Start date:
2014-06-24
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.4
Tags:
Complexity:
no-brainer
Is Regression:
No
Sprint Focus:

Description

The CLI offers a help which prints the informations of a command

./cli_dispatch.phpsh extbase extensionapi:fetch help
Fetch an extension from TER.

COMMAND:
  core_a_p_i:extensionapi:fetch

USAGE:
  /Volumes/HDD/Users/sok/Sites/TYPO3/www.coreapi.dev/http/./typo3cms ./typo3cms extensionapi:fetch [<options>] <key>

ARGUMENTS:
  --key                The extension key

OPTIONS:
  --version            The exact version of the extension, otherwise the latest
                       will be picked
  --location           Where to put the extension. System = typo3/sysext,
                       Global = typo3/ext, Local = typo3conf/ext
  --overwrite          $overwrite Overwrite the extension if already exists
  --mirror             $mirror    Mirror to fetch the extension from. Run
                       extensionapi:listmirrors to get the list of all
                       available repositories, otherwise a random mirror will
                       be selected

The text will be extracted by Reflection from the doc header of the method.

/**
 * Fetch an extension from TER.
 *
 * @param string $key       The extension key
 * @param string $version   The exact version of the extension, otherwise the latest will be picked
 * @param string $location  Where to put the extension. System = typo3/sysext, Global = typo3/ext, Local = typo3conf/ext
 * @param bool   $overwrite Overwrite the extension if already exists
 * @param int    $mirror    Mirror to fetch the extension from. Run extensionapi:listmirrors to get the list of all available repositories, otherwise a random mirror will be selected
 *
 * @return void
 */

As you can see the help text includes sometimes the name of the variable ($override, $mirror). This happens when there are more than one whitespaces between the datatype and the variable, which is needed to align the header comment.

Actions #1

Updated by Gerrit Code Review almost 10 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 https://review.typo3.org/31106

Actions #2

Updated by Helmut Hummel almost 10 years ago

  • Status changed from Under Review to Needs Feedback

Stefano Kowalke wrote:

As you can see the help text includes sometimes the name of the variable ($override, $mirror). This happens when there are more than one whitespaces between the datatype and the variable, which is needed to align the header comment.

As far as I know, such aligning of variables is against our CGLs. So Question is whether we want to support that by the help command

Actions #3

Updated by Stefano Kowalke almost 10 years ago

I can't find any passage where the CGL is against aligning. Its just not mentioned. After a discussion with Sebastian Kurf├╝rst years ago. We implemented the support of aligning in the PHPCS Sniffs. IMO that is exactly what the CGL says - its in the hand of the developer.

Personally I tend to the aligned version because the code becomes more readable.

Actions #4

Updated by Stefan Neufeind almost 10 years ago

I feel we agreed upon not aligning but indenting with only one space (at least in CGL for the core).
But for outputting the help-text I agree that exploiding with taking into account multiple whitespaces (and that might include tabs as well etc.) is a good idea though.

Actions #5

Updated by Gerrit Code Review almost 10 years ago

  • Status changed from Needs Feedback to Under Review

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/31106

Actions #6

Updated by Gerrit Code Review almost 10 years ago

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/31106

Actions #7

Updated by Helmut Hummel almost 10 years ago

Stefano Kowalke wrote:

I can't find any passage where the CGL is against aligning. Its just not mentioned.

http://docs.typo3.org/typo3cms/CodingGuidelinesReference/PhpFileFormatting/UsingPhpdoc/Index.html

"The single parts of information for a phpDoc keyword are separated by one single space."

This sentence is pretty clear to me.
The question is: should we nevertheless change the help text parser to be a bit more relaxed to support other coding styles.

I tend to not do it, but wouldn't strongly object such a change. It is a low risk and pretty straightforward change...

Actions #8

Updated by Gerrit Code Review almost 10 years ago

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

Actions #9

Updated by Gerrit Code Review almost 10 years ago

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

Actions #10

Updated by Gerrit Code Review almost 10 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/31857

Actions #11

Updated by Stefano Kowalke almost 10 years ago

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

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF