Comments (7)
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.
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.
I don't think adding paginated help is something we should do: it would complicate things too much imo.
from neil.
@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.
I think we should first solve babashka/babashka#1299 before we can reliably do ANSI.
from neil.
IMO it's not that important, but feel free to create an issue for it.
from neil.
Sounds good. I agree that the issue you linked higher priority.
from neil.
Related Issues (20)
- Make `:version` consistent over `search` and `dep add` commands HOT 1
- neil does not find a newer version of a library that antq does HOT 2
- `neil new`: Support Git repos without tags
- add support to add files which describe "development" environments HOT 2
- Error on dep update HOT 1
- Unable to install `com.cnuernber/ham-fisted` with Neil 0.1.59 HOT 2
- `neil dep upgrade` should update unstable versions HOT 2
- Error when running `neil --version` on versions `>=0.1.58` HOT 1
- Suggestion: `neil dep local <lib> <path>` HOT 2
- neil dep upgrade drops dep :exclusions HOT 2
- Neil completely crashes on fresh install HOT 24
- `neil dep add` exits with code 0 on both failure and success HOT 1
- Neil new behaviour different for windows HOT 4
- NPE on `neil dep upgrade ` HOT 5
- suggestion: support `neil add nrepl -with-cider` HOT 3
- Documentation: add git as a requirement HOT 1
- Feature request: a flag that does what `dep search` already does, but works for multiple artifacts and outputs a string suitable for `-Sdeps` HOT 3
- Neil does not use the latest version of slipset/deps-deploy in the `neil add build` command
- suggestion: use DEPS_CLJ_TOOLS_DIR to detect DEPS_CLJ_TOOLS_VERSION HOT 2
- Newlines should be added when adding dependencies HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neil.