From bcbb2136135c33111d2cc07c8b493813cff21cea Mon Sep 17 00:00:00 2001 From: Michael Zhou Date: Sat, 3 Nov 2018 10:40:06 -0400 Subject: [PATCH] Added command-line option explanations and usage examples Signed-off-by: Michael Zhou --- tuf/scripts/client.py | 12 ++++-- tuf/scripts/repo.py | 86 +++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 91 insertions(+), 7 deletions(-) diff --git a/tuf/scripts/client.py b/tuf/scripts/client.py index 23f1707a..9b07743c 100755 --- a/tuf/scripts/client.py +++ b/tuf/scripts/client.py @@ -47,10 +47,16 @@ --verbose: Set the verbosity level of logging messages. Accepts values 1-5. + + Example: + $ client.py --repo http://localhost:8001 --verbose 3 README.txt --repo: Set the repository mirror that will be responding to client requests. - E.g., 'http://locahost:8001'. + E.g., 'http://localhost:8001'. + + Example: + $ client.py --repo http://localhost:8001 README.txt """ # Help with Python 3 compatibility, where the print statement is a function, an @@ -156,8 +162,8 @@ def parse_arguments(): as specified by the user through the --verbose option. 'client' expects the '--repo' to be set by the user. - Exampl: - $ client.py --repo http://localhost:8001 + Example: + $ client.py --repo http://localhost:8001 LICENSE If the required option is unset, a parser error is printed and the scripts exits. diff --git a/tuf/scripts/repo.py b/tuf/scripts/repo.py index 447aad1e..6689a42b 100755 --- a/tuf/scripts/repo.py +++ b/tuf/scripts/repo.py @@ -40,17 +40,95 @@ $ repo.py --key [--filename --path , --pw [my_password]] - $ repo.py --delegate --delegatee --pubkeys - [role --terminating --threshold + [--role --terminating --threshold --sign ] - $ repo.py --revoke --delegatee [--role --sign ] - $ repo.py --verbose <0-5> $ repo.py --clean [--path] + + + --init: + Create new TUF repository in current working or specified directory. + + --consistent: + Enable consistent snapshots for newly created TUF repository. + + --bare: + Specify creation of bare TUF repository with no key created or set. + + --path: + Choose specified path location of a TUF repository or key(s). + + --role: + Specify top-level role(s) affected by the main command-line option. + + --pubkeys: + Indicate location of key(s) affected by the main command-line option. + + --root_pw: + Set password for encrypting top-level key file of root role. + + --targets_pw: + Set password for encrypting top-level key file of targets role. + + --snapshot_pw: + Set password for encrypting top-level key file of snapshot role. + + --timestamp_pw: + Set password for encrypting top-level key file of timestamp role. + + --add: + Add file specified by to the Targets metadata. + + --recursive: + Include files in subdirectories of specified directory . + + --remove: + Remove target files from Targets metadata matching . + + --distrust: + Discontinue trust of keys located in directory of a role. + + --trust: + Indicate trusted keys located in directory of a role. + + --sign: + Sign metadata of target role(s) with keys in specified directory. + + --key: + Generate cryptographic key of specified type (default: Ed25519). + + --filename: + Specify filename associated with generated top-level key. + + --pw: + Set password for the generated key of specified type . + + --delegate: + Delegate trust of target files from Targets role (or specified + in --role) to --delegatee role with specified . + + --delegatee: + Specify role that is targetted by delegator in --role to sign for + target files matching delegated or in revocation of trust. + + --terminating: + Mark delegation to --delegatee role from delegator as a terminating one. + + --threshold: + Specify signature threshold of --delegatee role as the value . + + --revoke: + Revoke trust of target files from delegated role (--delegatee) + + --verbose: + Set the verbosity level of logging messages. Accepts values 1-5. + + --clean: + Delete repo in current working or specified directory. """ # Help with Python 2+3 compatibility, where the print statement is a function,