iScsc / iscsc.fr

The iScsc website, build with passion by wannabe devs 🔥
GNU General Public License v3.0
4 stars 12 forks source link

FEATURE: add flag support to the `gpg-share` script #48

Closed amtoine closed 1 year ago

amtoine commented 1 year ago

This PR adds a bunch of flags to the gpg-share.sh script, to make its use both documented and easier. This PR will close #37.

the changes

details about the usage

one can see the following

> ./scripts/gpg-share.sh -h
gpg-share:
     a script to share a secret file with others using pgp public keys.
     it should guide you when you make mistakes, e.g. providing a non-existing file.

Usage:
     gpg-share [-h] -f FILE {-u USER} {-U USER_FILE}

Options:
     -h/--help               shows this help.
     -f/--file               the secret file to share.
     -u/--user               a single user id in the keyring.
                               can be used multiple times.
                               supports multi-word ids inside quotes, e.g. "John Smith".
     -U/--users              the path to a file containing pgp ids.
                               should contain exactly one valid pgp id per line.
                               can be used multiple times.

the -u and -U flags can be used multiple times, and they are meant to be used as such to avoid word splitting issues with bash, i chose to implement the flag parsing as follows:

this is the meaning of the { ... } in the usage! they mean the -u and -U flags can be used any number of times :+1:

what i did not do for now

amtoine commented 1 year ago

Thanks for your work once again an amazing job rocket

glad you like it :relieved:

I think we're ready to merge, I however suggest that we wait some time for @vSt11 review/approval (in an educational will), but @amtoine feel free to merge this PR if @vSt11 doesn't answer in the coming days wink

no no, there's no rush, this PR can wait for @vSt11 :yum: