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

catj should accept stdin input #532

Closed
ry opened this issue Jul 9, 2019 · 3 comments · Fixed by #533
Closed

catj should accept stdin input #532

ry opened this issue Jul 9, 2019 · 3 comments · Fixed by #533

Comments

@ry
Copy link
Member

ry commented Jul 9, 2019

curl https://ci.appveyor.com/api/projects/deno/deno/builds/25856198 | catj

(also can we rename it from catjson to catj ?)

@bartlomieju
Copy link
Member

Try:

curl https://ci.appveyor.com/api/projects/deno/deno/builds/25856198 | catj -

There's no easy way to check if there's something to read from stdin in Deno (if there's nothing it will block forever), that's why - is needed.

@ry
Copy link
Member Author

ry commented Jul 10, 2019

Oh sorry ! I didn't even see that in the help text. But trying it now, it doesn't seem to work.

> cat log.json | catj -
Usage: catjson [-h|--help] [file...]

Examples:

// print file:
   catjson file.json

// print multiple files:
   catjson file1.json file2.json

// print from stdin:
   cat file.json | catjson -

@bartlomieju
Copy link
Member

I just checked and indeed it's not working... I think flag parsing after script name in v0.11.0 might have broken it. I'll investigate in the evening.

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

Successfully merging a pull request may close this issue.

2 participants