GithubHelp home page GithubHelp logo

Comments (7)

borkdude avatar borkdude commented on July 20, 2024

Are there any other tools that do this? Why not let the user do the piping? What if the user pipes the output to a file, then we should not emit ansi escape codes. Should we write a man page instead?

Also see babashka/babashka#1299

from neil.

rads avatar rads commented on July 20, 2024

@borkdude:

Are there any other tools that do this?

I did a quick survey on my machine and to my surprise the only command I could find that did this was less --help. 😆 So you have a point there. That said, if we in the Clojure community were to extract the ANSI colors and pagination into a small library and set a standard so that any CLI tool could work consistently like this out-of-the-box, it seems like that would be a good thing.

To put things in perspective, this isn't a huge priority for me, because I know there are other important things we can solve instead. No need to worry about this too much if you disagree with what I'm saying here, but I at least wanted to share my feelings about it. I would rank the ANSI formatting higher than the pagination since the ANSI formatting requires us as implementors to specify where the formatting should be. In contrast the pagination can be filled in by the user.

Why not let the user do the piping?

The best user experience should be the default. I think in practice most people would appreciate it if these things just worked out-of-the-box. Key word here being default, since it would still be possible to opt-out.

What if the user pipes the output to a file, then we should not emit ansi escape codes.

Yeah, I think this is doable. In contrast to the pagination behavior, I was able to find a couple examples of modern tools with colorized help (bun, docker). When I pipe the help output of these tools to a file, the ANSI codes are removed as expected.

Should we write a man page instead?

I think the man pages would be in a different format from the --help text, right? The problem is writing and formatting docs is pretty time consuming so I want to stay away from duplicating any efforts there, especially given our limited dev time.

from neil.

borkdude avatar borkdude commented on July 20, 2024

I don't think adding paginated help is something we should do: it would complicate things too much imo.

from neil.

rads avatar rads commented on July 20, 2024

@borkdude: Understood. Does that mean ANSI formatting is still on the table? If so I'll make a placeholder issue just for that, otherwise I will just move on to other stuff.

from neil.

borkdude avatar borkdude commented on July 20, 2024

I think we should first solve babashka/babashka#1299 before we can reliably do ANSI.

from neil.

borkdude avatar borkdude commented on July 20, 2024

IMO it's not that important, but feel free to create an issue for it.

from neil.

rads avatar rads commented on July 20, 2024

Sounds good. I agree that the issue you linked higher priority.

from neil.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.