Skip to content

Commit bcbb213

Browse files
committed
Added command-line option explanations and usage examples
Signed-off-by: Michael Zhou <myz227@nyu.edu>
1 parent 7e0c4cc commit bcbb213

File tree

2 files changed

+91
-7
lines changed

2 files changed

+91
-7
lines changed

tuf/scripts/client.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,16 @@
4747
<Options>
4848
--verbose:
4949
Set the verbosity level of logging messages. Accepts values 1-5.
50+
51+
Example:
52+
$ client.py --repo http://localhost:8001 --verbose 3 README.txt
5053
5154
--repo:
5255
Set the repository mirror that will be responding to client requests.
53-
E.g., 'http://locahost:8001'.
56+
E.g., 'http://localhost:8001'.
57+
58+
Example:
59+
$ client.py --repo http://localhost:8001 README.txt
5460
"""
5561

5662
# Help with Python 3 compatibility, where the print statement is a function, an
@@ -156,8 +162,8 @@ def parse_arguments():
156162
as specified by the user through the --verbose option.
157163
'client' expects the '--repo' to be set by the user.
158164
159-
Exampl:
160-
$ client.py --repo http://localhost:8001 <target>
165+
Example:
166+
$ client.py --repo http://localhost:8001 LICENSE
161167
162168
If the required option is unset, a parser error is printed
163169
and the scripts exits.

tuf/scripts/repo.py

Lines changed: 82 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,95 @@
4040
$ repo.py --key <keytype>
4141
[--filename <filename>
4242
--path </path/to/repo>, --pw [my_password]]
43-
4443
$ repo.py --delegate <glob pattern> --delegatee <rolename>
4544
--pubkeys </path/to/pubkey>
46-
[role <rolename> --terminating --threshold <X>
45+
[--role <rolename> --terminating --threshold <X>
4746
--sign </path/to/role_privkey>]
48-
4947
$ repo.py --revoke --delegatee <rolename>
5048
[--role <rolename> --sign </path/to/role_privkey>]
51-
5249
$ repo.py --verbose <0-5>
5350
$ repo.py --clean [--path]
51+
52+
<Options>
53+
--init:
54+
Create new TUF repository in current working or specified directory.
55+
56+
--consistent:
57+
Enable consistent snapshots for newly created TUF repository.
58+
59+
--bare:
60+
Specify creation of bare TUF repository with no key created or set.
61+
62+
--path:
63+
Choose specified path location of a TUF repository or key(s).
64+
65+
--role:
66+
Specify top-level role(s) affected by the main command-line option.
67+
68+
--pubkeys:
69+
Indicate location of key(s) affected by the main command-line option.
70+
71+
--root_pw:
72+
Set password for encrypting top-level key file of root role.
73+
74+
--targets_pw:
75+
Set password for encrypting top-level key file of targets role.
76+
77+
--snapshot_pw:
78+
Set password for encrypting top-level key file of snapshot role.
79+
80+
--timestamp_pw:
81+
Set password for encrypting top-level key file of timestamp role.
82+
83+
--add:
84+
Add file specified by <target> to the Targets metadata.
85+
86+
--recursive:
87+
Include files in subdirectories of specified directory <dir>.
88+
89+
--remove:
90+
Remove target files from Targets metadata matching <glob pattern>.
91+
92+
--distrust:
93+
Discontinue trust of keys located in </path/to/pubkey> directory of a role.
94+
95+
--trust:
96+
Indicate trusted keys located in </path/to/pubkey> directory of a role.
97+
98+
--sign:
99+
Sign metadata of target role(s) with keys in specified directory.
100+
101+
--key:
102+
Generate cryptographic key of specified type <keytype> (default: Ed25519).
103+
104+
--filename:
105+
Specify filename associated with generated top-level key.
106+
107+
--pw:
108+
Set password for the generated key of specified type <keytype>.
109+
110+
--delegate:
111+
Delegate trust of target files from Targets role (or <rolename> specified
112+
in --role) to --delegatee role with specified <rolename>.
113+
114+
--delegatee:
115+
Specify role that is targetted by delegator in --role to sign for
116+
target files matching delegated <glob pattern> or in revocation of trust.
117+
118+
--terminating:
119+
Mark delegation to --delegatee role from delegator as a terminating one.
120+
121+
--threshold:
122+
Specify signature threshold of --delegatee role as the value <X>.
123+
124+
--revoke:
125+
Revoke trust of target files from delegated role (--delegatee)
126+
127+
--verbose:
128+
Set the verbosity level of logging messages. Accepts values 1-5.
129+
130+
--clean:
131+
Delete repo in current working or specified directory.
54132
"""
55133

56134
# Help with Python 2+3 compatibility, where the print statement is a function,

0 commit comments

Comments
 (0)