[GitHub] maven pull request #114: MNG-6220 add color CLI option

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] maven pull request #114: MNG-6220 add color CLI option

lamyaa
GitHub user mryan43 opened a pull request:

    https://github.com/apache/maven/pull/114

    MNG-6220 add color CLI option

    https://issues.apache.org/jira/browse/MNG-6220

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/mryan43/maven master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/maven/pull/114.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #114
   
----
commit 472a8866549ed1ee4e2dd53b8f4ff219c7d2f95a
Author: mryan <[hidden email]>
Date:   2017-04-18T08:57:23Z

    MNG-6220 add color CLI option

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] maven issue #114: MNG-6220 add color CLI option

lamyaa
Github user michael-o commented on the issue:

    https://github.com/apache/maven/pull/114
 
    I will comment shortly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] maven issue #114: MNG-6220 add color CLI option

lamyaa
In reply to this post by lamyaa
Github user michael-o commented on the issue:

    https://github.com/apache/maven/pull/114
 
    They are several issues. People are used to [GNU](https://www.gnu.org/software/grep/manual/grep.html#General-Output-Control) and [BSD](https://www.freebsd.org/cgi/man.cgi?query=grep&sourceid=opensearch) tools like grep. They use values `never`, `always`, `auto`. Having said that I do think we need to do this exactly the same way: [`grep.c`](https://github.com/freebsd/freebsd/blob/master/usr.bin/grep/grep.c#L627-L647). Option `always` requires special attention due to `isatty` in combination with `less(1)`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] maven issue #114: MNG-6220 add color CLI option

lamyaa
In reply to this post by lamyaa
Github user michael-o commented on the issue:

    https://github.com/apache/maven/pull/114
 
    Two issues:
   
    1. Unfortunately, Commons CLI does not offer valid values. If it would, it would fail if the option value is wrong. I would do so too.
    2. You blindly `return` from `always`, but still forget that Jansi will ignore that because `isatty` returns false as soon as `stdout` is passed via pipe.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] maven issue #114: MNG-6220 add color CLI option

lamyaa
In reply to this post by lamyaa
Github user mryan43 commented on the issue:

    https://github.com/apache/maven/pull/114
 
    Good idea to align the name of choices with grep, I just changed it.
   
    About "isatty", do you think we should set the jansi.force system property when --color is set to "always" ? https://github.com/fusesource/jansi/blob/2616142fda4425d779ac94a3d9bfa76412021b23/jansi/src/main/java/org/fusesource/jansi/AnsiConsole.java
     


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] maven issue #114: MNG-6220 add color CLI option

lamyaa
In reply to this post by lamyaa
Github user michael-o commented on the issue:

    https://github.com/apache/maven/pull/114
 
    I think yes, grep doesn't do different. Please try the patch thoroughly!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] maven issue #114: MNG-6220 add color CLI option

lamyaa
In reply to this post by lamyaa
Github user mryan43 commented on the issue:

    https://github.com/apache/maven/pull/114
 
    I will test with less and jenkins and comment again with results.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] maven issue #114: MNG-6220 add color CLI option

lamyaa
In reply to this post by lamyaa
Github user mryan43 commented on the issue:

    https://github.com/apache/maven/pull/114
 
    Unfortunately, the system property is read only once in a static init block in the JansiConsole class before the cli main method is invoked, so my change doesn't work.
   
    We have a kind of chicken and egg situation and we need to decide if we prefer
   
    a) not setting up Jansi until arguments/config have been parsed and validated (and call MessageUtils.systemInstall(); later in the loggin() method)
   
    b) forcing jansi until arguments and config have been parsed (by adding System.setProperty( "jansi.force", "true" ); before MessageUtils.systemInstall(); in MavenCli#main and then eventually disable it later in the loggin() method
   
    What do you think ?
     



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] maven issue #114: MNG-6220 add color CLI option

lamyaa
In reply to this post by lamyaa
Github user mryan43 commented on the issue:

    https://github.com/apache/maven/pull/114
 
    I applied solution B.
   
    I have added an auto-detection method in MessageUtils in my fork of maven-shared-utils (https://github.com/mryan43/maven-shared) based on the corresponding code in jansi.
   
    Unfortunately, upgrading to 3.2.0-SNAPSHOT from maven breaks compilation because of changes done for MSHARED-587 but I'm affraid fixing them would be out of scope of this PR.
   
   
   
   



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...