Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Tweaked some console command styles #14196

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

Closed

Conversation

javiereguiluz
Copy link
Member

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #14174
License MIT
Doc PR -

As discussed, after updating the first console commands to the new style guide, we were going to introduce the needed tweaks. This PR is the first one with those tweaks.

Tables

Headers now are displayed in the usual green color used frequently by Symfony commands:

table_header

Command tiles and section titles

I see these titles in a beautiful blue color ... but lots of people use color schemes which make them almost unreadable. Now they use the yellow color frequently used by Symfony commands:

command_section_titles

Listings

Elements in a listing no longer add an extra blank line. See #14174 for the rationale.

@stof
Copy link
Member

stof commented Apr 3, 2015

👍

@hhamon
Copy link
Contributor

hhamon commented Apr 3, 2015

Nice job Javier!

@aitboudad
Copy link
Contributor

👍

@fabpot
Copy link
Member

fabpot commented Apr 3, 2015

Thank you @javiereguiluz.

@fabpot fabpot closed this Apr 3, 2015
fabpot added a commit that referenced this pull request Apr 3, 2015
This PR was squashed before being merged into the 2.7 branch (closes #14196).

Discussion
----------

Tweaked some console command styles

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #14174
| License       | MIT
| Doc PR        | -

As discussed, after updating the first console commands to the new style guide, we were going to introduce the needed tweaks. This PR is the first one with those tweaks.

### Tables

Headers now are displayed in the usual green color used frequently by Symfony commands:

![table_header](https://cloud.githubusercontent.com/assets/73419/6980286/a126e8cc-d9ef-11e4-8d1e-9a5be21564eb.png)

### Command tiles and section titles

I see these titles in a beautiful blue color ... but lots of people use color schemes which make them almost unreadable. Now they use the yellow color frequently used by Symfony commands:

![command_section_titles](https://cloud.githubusercontent.com/assets/73419/6980292/b499627c-d9ef-11e4-9940-e134ee0eb02f.png)

### Listings

Elements in a listing no longer add an extra blank line. See #14174 for the rationale.

Commits
-------

dcf1801 Tweaked some console command styles
@@ -183,6 +183,8 @@ public function caution($message)
*/
public function table(array $headers, array $rows)
{
$headers = array_map(function ($value) { return sprintf('<info>%s</>', $value); }, $headers);
Copy link
Member

Choose a reason for hiding this comment

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

Just out of interest: what's the advantage of </>? I'm seeing it more and more these days and I'm not sure why. Probably, there is a reason for it.

Copy link
Member

Choose a reason for hiding this comment

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

I'm the one who introduced that, so, mainly to avoid too much noise.

Copy link
Member Author

Choose a reason for hiding this comment

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

I personally use it because the code looks more much concise and clear to me. Since this is just markup and not "real code", I want it to mess my code as less as possible. That's why using </info> looks very repetitive to me. When using custom styles (e.g. <fg=blue>) duplicating it in the closing tag loks awfully boring to me.

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.

6 participants