-
Notifications
You must be signed in to change notification settings - Fork 3
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 IO into CLI #6
Conversation
cool! this doesn't support passing in an input string directly, correct? (i.e |
It doesn't, so you'll have to use |
I think we should Go for something like #2 (comment) as it feels more familiar and is much nicer when not wanting to encode a file |
I'm not sure what's more familiar about that. Almost any Unix tools I know of does something similar:
Everybody who's remotely familiar with the terminal knows the |
GNU's I've seen a mix, most of the "standard" tools use files but there's still popular tools that either support both or you prefix files with a flag (ffmpeg comes to mind). I don't have a strong preference but based on feedback I'm absolutely willing to reconsider. If we stick to @K1ngjulien what do you think? |
Yeah you're right, I hadn't really thought of that. The standard unix way is definitely a more familiar version and the way to go. Tho I agree that most people will be using bottom in a one off fashon for quck encodes. So maybe an additional flag for passing in strings directly could be added, which would error when also passing a filename at the same time:
This way you wouldn't have to pipe in all your text from echo Thougts? |
Is doing |
TIL about Well in that case, ship it🚀 |
Related #7 |
This pull request adds the flag
-o
to set the output; it also accepts the first argument for the input. Both IO arguments can take-
for stdio.Usage:
This pull request also moved the CLI into
./cmd/bottom
for idiomaticity. The command to install it would therefore be:API breakage:
This pull request breaks the existing
EncodeTo
function signature to remove the total bytes written. This is because the function will either write everything successfully or error out, and the caller can manually keep track of the written length by wrapping the writer.This PR closes #2.