Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #2106. Port help commands to Annotated. #2670

Merged
merged 34 commits into from
Mar 27, 2017
Merged

Fix #2106. Port help commands to Annotated. #2670

merged 34 commits into from
Mar 27, 2017

Conversation

weitzman
Copy link
Member

@weitzman weitzman commented Mar 13, 2017

A start at porting help and helpsingle commands. I'm happy with the output of Console's list command (only gripe is that it wants to list all global options which is a currently long list in our case.)

The output appears to need a colspan for the category titles. How to do this with Consolidated/OutputFormatters? Or should I bypass that and Output via Console's Table class directly? Ping @greg-1-anderson

@weitzman
Copy link
Member Author

weitzman commented Mar 16, 2017

@weitzman
Copy link
Member Author

weitzman commented Mar 18, 2017

I'm now reusing HelpDocument from Annotated-Command project. Drush is supplying its own formatter for CLI presentation of help. Ping @greg-1-anderson for input on the list below.

Bugs

  1. We have a legitimate test fail at https://github.com/drush-ops/drush/blob/helpAnnotated/tests/annotatedCommandTest.php#L70. For some reason, when help gets an $application, the woot command is not in there. We are successfully bootstrapping Drupal. Fixed. we were not registering Commands from discovered modules (e.g. woot) with the Application.
  2. Global options are appearing in command help due to Console's mergeApplicationDefinition() which merges together command options and global options. I'd rather show a subset and move those to own section. Might be fixable in future with a Console update to 3.1+. An alternative would be to honor hidden options (this is a Drush-only concept right now). Fixed - depends on Unprotect two methods for benefit of Drush help. consolidation/annotated-command#99
  3. List command fails with a helpful error message Cannot convert data from a DOM document to an array, because <command> appears more than once, and is not wrapped in a <commands> element. . I'm matching Symfony's XML:
<namespaces>
  <namespace id="watchdog">
    <command>watchdog-show</command>
    <command>watchdog-list</command>
    <command>watchdog-delete</command>
    <command>watchdog-show-one</command>
  </namespace>
</namespaces>
  1. Table wrapping is poor in both list and help commands. Related Improve table wrapping #2603.

Nice to have

  1. HelpDocument doesn't supply the default value for arguments. This would be a small improvement over Console help.
  2. Hide hidden options. Console does not support hidden options. I guess this will be a Drush-only feature?
  3. help isn't yet making use of the description and the "long description" of a command.

@weitzman weitzman changed the title [WIP] Fix #2106. Port help commands to Annotated. Fix #2106. Port help commands to Annotated. Mar 27, 2017
@weitzman weitzman merged commit a24c6e6 into master Mar 27, 2017
@weitzman weitzman deleted the helpAnnotated branch March 27, 2017 17:53
mikeker pushed a commit to mikeker/drush that referenced this pull request Aug 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant