Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Normalize console usage #4061

Closed

Conversation

bakura10
Copy link
Contributor

Hi,

This is a PR that attempt to answer a problem that I outlined here: #3731

Basically, I'm using a few modules that have console commands. The problem that arised is that it quickly becomes a mess for three main reasons:

  1. There are no colors by default that help me to separate each module.
  2. Each module owner have their own conventions for banner...
  3. The getConsoleBanner was misused by me (and a lot of other people too).

What I thought first is that getConsoleBanner was used to tell the name of the module, so that the following logic were used: banner 1, usage 1, banner 2, usage 2... However, as @Thinkscape outlined to me, banners are all appended at the beginning and should remain short (name of the module and version).

My idea is to automatically generate module name separators, with some pre-defined colors that visually separate each module. We would also need to update the doc so that people are encouraged to follow the same conventions:

  1. getConsoleBanner should return a ONE-LINE only with name of module + version of module. This way, all modules are clearly shown at the beginning of the console.
  2. getConsoleUsage SHOULD NOT return the name of the module as this is automatically done now by the Console component itself. This one should only return... well.. usage. This is not a BC. At worst, people that wrote the module name in the usage, it will just write it twice (the user one and the automatically generated one).

For those who want to see the result, here it is (I'm open to discuss about color choices):

http://cl.ly/image/47203A0c0i1c

As you can see, the module names are all appended at the beginning in blue, while each module are separated by the module name wrapped around dashes (those take the whole console width).

What do you think ?

@Thinkscape
Copy link
Member

We had a discussion on #3731.

@tca3
Copy link
Contributor

tca3 commented Mar 18, 2013

IMO the module names needn't to be colorized. Besides, the color blue is not the choice I would go with since a lot of consoles come with a black background by default, if not blue !

@bakura10
Copy link
Contributor Author

Yeah, the color choice was a bit arbitrary...

@tca3
Copy link
Contributor

tca3 commented Mar 18, 2013

I don't think any colorization is needed here, but I'm happy with the new output.

weierophinney added a commit that referenced this pull request Mar 28, 2013
weierophinney added a commit that referenced this pull request Mar 28, 2013
- made intent more clear
weierophinney added a commit that referenced this pull request Mar 28, 2013
@ghost ghost assigned weierophinney Mar 28, 2013
@weierophinney
Copy link
Member

I've merged, because I feel the functionality makes sense, and it solves an issue I've already observed. If somebody wants to do a PR later with different colors, omission of colors, or configurable colors, that's fine.

@Thinkscape
Copy link
Member

omg... really ? Now every time I run any app it looks like something broke down...

image

@weierophinney
Copy link
Member

@Thinkscape Note that I said this:

If somebody wants to do a PR later with different colors, omission of colors, or configurable colors, that's fine.

So, submit a PR if you don't like the selected colors.

timdev pushed a commit to timdev/SlmQueueBeanstalkd that referenced this pull request Apr 5, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants