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

Add command to generate Bash autocomplete script #221

Merged
merged 2 commits into from Jun 17, 2014

Conversation

pierredup
Copy link
Member

Q A
Bug Fix? n
New Feature? Y
BC Breaks? n
Deprecations? n
Tests Pass? Y
Fixed Tickets
License MIT
Doc PR

Add command to generate script for Bash autocompletion. This script allows autocomplete support when typing "gush" followed by a [tab], which gives you all the available commands, as well as the options for the commands

Sent using Gush

use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Helper\DescriptorHelper;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should go below line 14 right?


$scriptFile = $config->get('home').DIRECTORY_SEPARATOR.self::AUTOCOMPLETE_SCRIPT;

$file = @file_put_contents($scriptFile, $script);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use Symfony Filesystem::dump()?

@scrutinizer-notifier
Copy link

The inspection completed: 23 new issues, 7 updated code elements


$dump = array_map(function ($options) use ($commonOptions) {
return array_diff($options, $commonOptions);
}, $dump);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we break the line on 82 and have the closure starting on the L83 and then after the , we break again to line up $dump with the closure?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that will line up L82 $dump = ... start with the closing ;

@cordoval
Copy link
Member

merging as @pierredup will send another PR covering the changes, thanks 👍 great job 😊

cordoval added a commit that referenced this pull request Jun 17, 2014
Add command to generate Bash autocomplete script
@cordoval cordoval merged commit 5deb4e4 into gushphp:master Jun 17, 2014
@pierredup pierredup deleted the autocomplete branch September 14, 2015 17:37
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.

None yet

4 participants