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

Make it possible to do alias cat=hicat #6

Closed
sshaw opened this issue Oct 6, 2015 · 7 comments
Closed

Make it possible to do alias cat=hicat #6

sshaw opened this issue Oct 6, 2015 · 7 comments

Comments

@sshaw
Copy link

sshaw commented Oct 6, 2015

Just came across this and the first thing I thought was that I can maybe (finally) use a seamless alias for cat. Unfortunately, after a hicat --help, I realized this is not possible as cat -n == hicat -N.

IMHO supporting cat's options would make this a lot more useful, filling the void where other "cat replacements" (highlight, src-highlite, pygmentize, etc...) fall a bit short.

Most of cat's (small set of) options are not taken up by hicat. I think that -n and -e are the most popular.

Thoughts?

@rstacruz
Copy link
Owner

rstacruz commented Oct 6, 2015

this sounds like a terrible idea and will break things that scripts that rely on cat. nonetheless, -n seems like something that should come by default.

@sshaw
Copy link
Author

sshaw commented Oct 6, 2015

this sounds like a terrible idea and will break things that scripts that rely on

Actually the idea is to not break things. Hence this issue.

@rstacruz
Copy link
Owner

rstacruz commented Oct 6, 2015

Actually the idea is to not break things. Hence this issue.

Even something like cat *.css > combined.css? ;-)

@rstacruz
Copy link
Owner

rstacruz commented Oct 6, 2015

hmm, now that i think about it, that's actually kinda possible if we check process.stdout.isaTTY() and behave like a normal cat if it's true...

@sshaw
Copy link
Author

sshaw commented Oct 6, 2015

Actually the idea is to not break things. Hence this issue.

Even something like cat *.css > combined.css? ;-)
...
hmm, now that i think about it, that's actually kinda possible if we check process.stdout.isaTTY()

Heh yeah, figured this was implied. grep, ls, etc... have a --color options that's turned off then output is a TTY.

@sshaw
Copy link
Author

sshaw commented Oct 6, 2015

Though now that I think about maybe I really need a version of less with syntax highlighting. Or, a less filter that uses this -or the others I mentioned- to do so.

@rstacruz
Copy link
Owner

rstacruz commented Oct 7, 2015

Oh, I remember the design decision as to why it's -N and not -n. This is consistent with less -N, which hicat more closely resembles.

Hicat pages using less by default by the way: doing hicat longfile.txt will let you scroll through it using less.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants