From 394a17513e844de468725692c548c89e17000d88 Mon Sep 17 00:00:00 2001 From: r4sas Date: Sat, 18 Feb 2017 21:27:24 +0300 Subject: [PATCH] update --- README.md | 8 +++++++- pbincli.py | 26 ++++++++++++-------------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 33c957d..2f5ab11 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,10 @@ PBinCLI -======== +===== PrivateBin CLI (in development) + +installing +----- +virtualenv --python=python3 venv +. venv/bin/activate +pip install -r requirements.txt diff --git a/pbincli.py b/pbincli.py index 52edc12..b3851ad 100755 --- a/pbincli.py +++ b/pbincli.py @@ -9,22 +9,20 @@ from pbincli.utils import PBinCLIException def main(): parser = argparse.ArgumentParser() subparsers = parser.add_subparsers(title="actions", help="List of commands") + # a send command - send_parser = subparsers.add_parser("send", description="Send data to PrivateBin instance", usage="""%(prog)s --cert data/user_at_mail.i2p.crt --private-key data/priv_key.pem --signer-id user@mail.i2p""") - send_parser.add_argument("-b", "--burn", default=False, action="store_true", help="Burn after reading") - send_parser.add_argument("-d", "--discus", default=False, action="store_true", help="Open discussion") - send_parser.add_argument("-e", "--expire", default="1day", action="store", help="Expiration of paste") - send_parser.add_argument("-f", "--format", default="plaintext", action="store", help="Format of text paste") - send_parser.add_argument("-p", "--password", default=None, help="RSA private key (default: data/priv_key.pem)") - send_parser.add_argument("filename", type=argparse.FileType('r'), help="Filename (example: image.jpg)") + send_parser = subparsers.add_parser("send", description="Send data to PrivateBin instance", usage=""" +%(prog)s --burn --discus --expire 1day --format plaintext \\ + --password mypass image.txt""" + ) + send_parser.add_argument("-b", "--burn", default=False, action="store_true", help="burn sent paste after reading") + send_parser.add_argument("-d", "--discus", default=False, action="store_true", help="open discussion of sent paste") + send_parser.add_argument("-e", "--expire", default="1day", action="store", help="expiration of paste (default: 1day)") + send_parser.add_argument("-f", "--format", default="plaintext", action="store", help="format of paste (default: plaintext)") + send_parser.add_argument("-p", "--password", default=None, help="password for crypting paste") + send_parser.add_argument("filename", type=argparse.FileType('r'), help="filename (example: image.jpg)") send_parser.set_defaults(func=pbincli.actions.send) - '''# a get command - get_parser = subparsers.add_parser("get", description="Recieve data from PrivateBin instance", usage="""echo $YOUR_PASSWORD | %(prog)s --netdb /path/to/netDb --private-key data/priv_key.pem --outfile output/i2pseeds.su3 --signer-id user@mail.i2p""") - get_parser.add_argument("--signer-id", required=True, help="Identifier of certificate (example: user@mail.i2p)") - get_parser.add_argument("--private-key", default="data/priv_key.pem", help="RSA private key (default: data/priv_key.pem)") - get_parser.add_argument("-o", "--outfile", default="output/i2pseeds.su3", help="Output file (default: output/i2pseeds.su3)") - get_parser.add_argument("--netdb", required=True, help="Path to netDb folder (example: ~/.i2pd/netDb)") - get_parser.set_defaults(func=pyseeder.actions.reseed)''' + # parse arguments args = parser.parse_args() if hasattr(args, "func"):