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

Raw output option #271

Open
T145 opened this issue Jun 25, 2021 · 9 comments
Open

Raw output option #271

T145 opened this issue Jun 25, 2021 · 9 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@T145
Copy link

T145 commented Jun 25, 2021

Instead of #268, have a raw option to generate output that doesn't include emoji and the process indicator. This will help the results be piped into other programs like jq that people can then use to transform into JSON on their own. It could look like:

./lychee README.md --raw -v
@lebensterben
Copy link
Member

This is a good point.
Rust programmers are used to UTF compatibility but in reality other components in the toolchain may not be UTF compatible.

Meanwhile, if you can tell lychee to output results in JSON format. That's friendlier for jq.

@mre
Copy link
Member

mre commented Apr 25, 2022

This should work in master now to get raw output:

./lychee README.md --format=raw --no-progress -v

The NO_COLOR environment variable is also respected.
See #599 for details.

@mre
Copy link
Member

mre commented Apr 25, 2022

Gonna close this as resolved. Feel free to reopen if it doesn't work as expected.

@mre mre closed this as completed Apr 25, 2022
@alexanderbazhenoff
Copy link

Just wanna know how to enable colors in GitLab CI console? No info in README.

@mre
Copy link
Member

mre commented Apr 3, 2024

Sorry for the late reply.
You can try to set the NO_COLOR=1 environment variable, so

export NO_COLOR=1
lychee ...

or

NO_COLOR=1 lychee ...

@alexanderbazhenoff
Copy link

Sorry for the late reply. You can try to set the NO_COLOR=1 environment variable, so

No problem, but I meant enable colors :) Anyway neither NO_COLOR=0 (and NO_COLOR=false), nor NO_COLOR=1 (and NO_COLOR=true) got color changes in my GitLab CI, it's stll b/w. Using lychee-v0.14.3-aarch64-unknown-linux-gnu.tar.gz:

  script:
    - NO_COLOR=0 lychee -n .

lychee_bw

Any ideas?

mre added a commit that referenced this issue Apr 4, 2024
This adds support for formatting responses in different ways.
For now the options are
* `plain`: No color, basic formatting
* `color`: Color, indented formatting (default)
* `emoji`: Fancy mode with emoji icons

Fixes #546
Related to #271
@mre
Copy link
Member

mre commented Apr 4, 2024

@alexanderbazhenoff, I took a stab at it here: #1398
If you want, you can try it out by installing the version from that branch. I'd appreciate some feedback.

@mre mre reopened this Apr 4, 2024
mre added a commit that referenced this issue Apr 4, 2024
This adds support for formatting responses in different ways.
For now the options are
* `plain`: No color, basic formatting
* `color`: Color, indented formatting (default)
* `emoji`: Fancy mode with emoji icons

Fixes #546
Related to #271
mre added a commit that referenced this issue Apr 4, 2024
This adds support for formatting responses in different ways.
For now the options are
* `plain`: No color, basic formatting
* `color`: Color, indented formatting (default)
* `emoji`: Fancy mode with emoji icons

Fixes #546
Related to #271
mre added a commit that referenced this issue Apr 4, 2024
This adds support for formatting responses in different ways.
For now the options are
* `plain`: No color, basic formatting
* `color`: Color, indented formatting (default)
* `emoji`: Fancy mode with emoji icons

Fixes #546
Related to #271
@alexanderbazhenoff
Copy link

alexanderbazhenoff commented Apr 10, 2024

@alexanderbazhenoff, I took a stab at it here: #1398 If you want, you can try it out by installing the version from that branch. I'd appreciate some feedback.

Sorry for long reply.

I have placed a new binary alongside with an old, but named them as lychee2. So, -n --mode emoji worked as described behind, defaults still no color:

lychee-new

Runing the same defaults locally via console is nice and colored anyway:

lychee-local

No additional env variables set like COLOR/NO_COLOR in GitLab CI, just raw command run:

script:
  - lychee2 .

What I did wrong in my CI? Or what debug info from me is required?

@mre
Copy link
Member

mre commented Apr 15, 2024

I think the issue is on my end. Need to make more changes in the pull request. Apologies for the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants