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

Added file support to cli #79

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

vr-varad
Copy link

@vr-varad vr-varad commented Feb 15, 2025

Resolves #50

@dillonstreator
I tried to add the file support for encryption. I made the content optional and added a new option for file
so if user
encrypt -f /path/to/file
the content will be the content of the file or else it will be as the user provides it
Any feedback, suggestions or improvement
on confirmation will do for decryption

@dillonstreator dillonstreator marked this pull request as draft February 15, 2025 16:46
Copy link
Contributor

@dillonstreator dillonstreator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice - this makes sense. Added a few thoughts and I've moved the PR into draft until the decrypt side is also implemented.

@vr-varad
Copy link
Author

I had some doubts regarding the decryption.
The encrypted data is the content inside a file - string
if we decrypt the particular URL what we get is a string, how we know it was from a file or just a string content.

@vr-varad
Copy link
Author

vr-varad commented Feb 15, 2025

And regarding the
<content> I made it optional [content] becoz in place of the content we could give a file
using <content> makes it compulsory and we can't use a flag before content
@dillonstreator

@vr-varad
Copy link
Author

I have an idea regarding the decryption
we can add a -f tag with the path to directory where user want to get it copied
@dillonstreator What do u think abt that?

@dillonstreator
Copy link
Contributor

And regarding the <content> I made it optional [content] becoz in place of the content we could give a file using <content> makes it compulsory and we can't use a flag before content @dillonstreator

Ah gotcha I wasn't aware the brackets implied required vs. optional. FWIW - content is required if the flag is not provided so it's a bit more of a gray area.

@dillonstreator
Copy link
Contributor

dillonstreator commented Feb 20, 2025

@vr-varad -o for output is a bit more standard across many popular CLI tools (e.g., curl, wget, ffmpeg). Let's use -o and if there is no -o provided, send the contents of the file to stdout. This will enable users to pipe stdout wherever they'd like.

@vr-varad
Copy link
Author

@dillonstreator Done.
Let me know if there is any suggestions or improvement in code I can make.

@vr-varad
Copy link
Author

Any updates @dillonstreator

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 this pull request may close these issues.

add file support to cli
2 participants