-
Notifications
You must be signed in to change notification settings - Fork 2
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 CLI commands to the package #13
base: master
Are you sure you want to change the base?
Conversation
betacode/cli.py
Outdated
|
||
|
||
@click.command() | ||
@click.argument("text", nargs=-1, type=str) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think allowing a file to be input would be a useful addition (so either text or file input). It'd also make it easier to convert larger entries on the fly.
I know I'd also be paranoid about if shell does any magic to the escape characters :)
output can just be to stdout which user redirects as necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have now added this suggestion. All sorts of cool chaining is now possible, e.g.:
$ beta-to-uni < some_input_file.txt > some_output_file.txt
$ echo λόγος | uni-to-beta
$ cat some_input_file.txt | beta-to-uni
Thanks André for the PR! Glad to know this has been helpful to you. To me it looks like a good direction. I think it should be taken. I am thinking of moving this project to poetry to make it easier to support packaging and releases. In which case poetry supports cli commands and doesn't seem interoperable with click so I'd likely have to move move to that. But for now, this is a good addition and hope it simplifies things for you. |
Thanks for the feedback, I will soon take the time to process it. As for your comment regarding poetry: I'm not very experienced with it, but poetry supports a |
Hi!
Thanks for this great package! I use it a lot, and thought it might be helpfull to use it directly from the terminal, to improve my workflow. I therefore created the two terminal commands
beta-to-uni
anduni-to-beta
using click. I have created this PR to share this with you, should you be interested in it as well! Please refer to the added section in the README for instructions.Best,
André