owenthereal / ccat

Colorizing `cat`
https://github.com/owenthereal/ccat
MIT License
3.16k stars 118 forks source link

ccat command is already taken by ccrypt package on Ubuntu/Debian #7

Closed beberlei closed 9 years ago

owenthereal commented 9 years ago

Hmm....bumper, scat (Syntax highlighting cat) is also taken...I need to think of a cooler and unique name...

pixelr0 commented 9 years ago

cats? cats>cat

AustinDizzy commented 9 years ago

@jingweno Regardless of its availability, I would advise against using scat. A quick Google search will tell you why... Maybe syntac or syncat for a play on cat and syntax?

Or you could go a different route and just call it cat and aim for making this essentially just an enhanced cat in Go. Then, as long as your $GOPATH is before /bin in your $PATH, your version of cat will override the system default. If you choose to go that route, then it'd also be in your best interest to support all the flags and options cat(1) does to make it more of a replacement for cat.

hami9x commented 9 years ago

catsy?

wdawson4 commented 9 years ago

@AustinDizzy i would recommend against naming this cat and replacing cat with this package. To make the syntax highlighting work, it injects ANSI escape sequences into the text. The ANSI escape sequences will cause you all kinds of issues piping from cat For example:

local:~ wdawson$ echo "hello world" | base64 > hello_world64
local:~ wdawson$ cat hello_world64 | base64 --decode
hello world
local:~ wdawson$ ccat hello_world64 | base64 --decode
Invalid character in input stream.
local:~ wdawson$ ccat hello_world64
aGVsbG8gd29ybGQK

How about prettycat for a name

KeizerDev commented 9 years ago

How about catlight?

AustinDizzy commented 9 years ago

@wdawson4 Using https://godoc.org/golang.org/x/crypto/ssh/terminal#IsTerminal, you can tell if the program's output is being piped. Using that, a check can be set in main.go#ccat to return only the file's contents without syntax highlighting if the output is being piped. Then possibly a flag to output using the ANSI sequences regardless of whether the output is being piped or not.

-----Original Message----- From: Nick Dawson notifications@github.com To: jingweno/ccat ccat@noreply.github.com Cc: Austin Dizzy dizzy@wow.com Sent: Wed, May 6, 2015 1:46 pm Subject: Re: [ccat] ccat command is already taken by ccrypt package on Ubuntu/Debian (#7)

@AustinDizzy i would recommend against naming this cat replacing cat with this package. To make the syntax highlighting work, it injects ANSI escape sequences into the text. The ANSI escape sequences will cause you all kinds of issues piping from cat For example:

local:~ wdawson$ echo "hello world" | base64 > hello_world64 local:~ wdawson$ cat hello_world64 | base64 --decode hello world local:~ wdawson$ ccat hello_world64 | base64 --decode Invalid character in input stream. local:~ wdawson$ ccat hello_world64 aGVsbG8gd29ybGQK

— Reply to this email directly or view it on GitHub.

mattn commented 9 years ago

This will be fixed by https://github.com/jingweno/ccat/pull/12

hut8 commented 9 years ago

:+1: for scat :hankey:

owenthereal commented 9 years ago

Haha, :+1: to scat, but unfortunately ccat has already been released to the public, need a plan to safely migrate if we decide to do this

mattn commented 9 years ago

This is closable.

owenthereal commented 9 years ago

Closing.

astubbs commented 9 years ago

So sorry, what was the solution for ubuntu package management?

astubbs commented 9 years ago

Ah I see, welcome to the world of AUR and PPA's.. I saw the PPA comment in another issue here.