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

raw stdin-based input mode for piping expressions #644

Closed
ishaan-sen opened this issue Apr 11, 2024 · 2 comments
Closed

raw stdin-based input mode for piping expressions #644

ishaan-sen opened this issue Apr 11, 2024 · 2 comments

Comments

@ishaan-sen
Copy link

I frequently find myself piping expressions from terminal-based text editors like Helix into qalc for computation. I've looked, but I haven't yet found any way to make qalc accept input from standard input without printing the > prompt for interactive mode.
Currently, I have an alias that uses xargs to enter my expression as an argument to qalc -t. I was wondering if there could be a new CLI option for returning the result of an expression piped into stdin.

Is there already a way to do this? If not, I'm open to trying it and making a PR if this is wanted.

@hanna-kn
Copy link
Contributor

How about qalc -t -f -?
-f/--file tells qalc to read expressions and commands from the specified file (in this case stdin).

@ishaan-sen
Copy link
Author

Of course. Setting the file to stdin didn't occur to me. Thanks for the amazing calculator; I use it every day.

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