-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
Add file support #8
Comments
Is it a common pattern for all unix tools that work with stdin/stdout to also accept files as arguments? I don't see why it shouldn't be supported, but just wondering. I'm also thinking about multiple files. I'm guessing you would have |
Also, of course the tool hanging when given an argument is a bug :) |
Most (all?) of the *nix tools in the GNU Utils package that works on text works on files + stdin, cat, grep, more, less, tail ... So it's common. So common it was the first my fingers tried. Ideally it should work like |
Done. I've followed the pattern that |
I just noticed your mentioning of goroutines. For multiple files it could be used. They are cheap so that shouldn't be a problem, and it could indeed speed things up for large files or async I/O. The only disadvantage I can think of is that the urls will no longer be output in the correct order like |
The go routines would be a nice addon (not important), but is a different issue. |
Could you please open a separate issue describing it? |
Useful little util.
It would be nice if it, in addition to the stdin support, could work with file(s) as arguments.
Currently this works:
cat myfile.txt | xurls
This just hangs there, waiting:
xurls myfile.txt
An example of a Go tool that works as expected for a *nix CLI tool would be
ccat
.The text was updated successfully, but these errors were encountered: