|
1 | 1 | import json |
2 | 2 | import os |
3 | | -from pprint import pformat |
4 | 3 |
|
5 | 4 | import click |
6 | 5 | from py42.clients.cases import CaseStatus |
|
20 | 19 | case_number_option = click.option( |
21 | 20 | "--case-number", type=int, help="The number assigned to the case.", required=True |
22 | 21 | ) |
23 | | -name_option = click.option("--name", help="Name of the case.",) |
24 | | -assignee_option = click.option("--assignee", help="User UID of the assignee.") |
25 | | -description_option = click.option("--description", help="Description of the case.") |
26 | | -findings_option = click.option("--findings", help="Findings on the case.") |
27 | | -subject_option = click.option("--subject", help="User UID of a subject of the case.") |
| 22 | +name_option = click.option("--name", help="The name of the case.",) |
| 23 | +assignee_option = click.option( |
| 24 | + "--assignee", help="The UID of the user to assign to the case." |
| 25 | +) |
| 26 | +description_option = click.option("--description", help="The description of the case.") |
| 27 | +findings_option = click.option("--findings", help="Any findings for the case.") |
| 28 | +subject_option = click.option( |
| 29 | + "--subject", help="The user UID of the subject of the case." |
| 30 | +) |
28 | 31 | status_option = click.option( |
29 | 32 | "--status", |
30 | 33 | help="Status of the case. `OPEN` or `CLOSED`.", |
31 | 34 | type=click.Choice(CaseStatus.choices()), |
32 | 35 | ) |
33 | 36 | file_event_id_option = click.option( |
34 | | - "--event-id", required=True, help="File event id associated to the case." |
| 37 | + "--event-id", required=True, help="The file event ID associated with the case." |
35 | 38 | ) |
36 | | - |
37 | 39 | CASES_KEYWORD = "cases" |
38 | 40 | BEGIN_DATE_DICT = set_begin_default_dict(CASES_KEYWORD) |
39 | 41 | END_DATE_DICT = set_end_default_dict(CASES_KEYWORD) |
@@ -110,10 +112,10 @@ def update(state, case_number, name, subject, assignee, description, findings, s |
110 | 112 |
|
111 | 113 | @cases.command("list") |
112 | 114 | @click.option( |
113 | | - "--name", help="Filter by name of a case, supports partial name matches.", |
| 115 | + "--name", help="Filter by name of a case. Supports partial name matches.", |
114 | 116 | ) |
115 | | -@click.option("--subject", help="Filter by user UID of the subject of a case.") |
116 | | -@click.option("--assignee", help="Filter by user UID of assignee.") |
| 117 | +@click.option("--subject", help="Filter by the user UID of the subject of a case.") |
| 118 | +@click.option("--assignee", help="Filter by the user UID of an assignee.") |
117 | 119 | @click.option("--begin-create-time", **BEGIN_DATE_DICT) |
118 | 120 | @click.option("--end-create-time", **END_DATE_DICT) |
119 | 121 | @click.option("--begin-update-time", **BEGIN_DATE_DICT) |
@@ -162,7 +164,7 @@ def _get_file_events(sdk, case_number): |
162 | 164 | def _display_file_events(events): |
163 | 165 | if events: |
164 | 166 | click.echo("\nFile Events:\n") |
165 | | - click.echo(pformat(events)) |
| 167 | + click.echo(json.dumps(events, indent=4)) |
166 | 168 | else: |
167 | 169 | click.echo("\nNo events found.") |
168 | 170 |
|
@@ -190,7 +192,9 @@ def show(state, case_number, format, include_file_events): |
190 | 192 | @cases.command() |
191 | 193 | @case_number_arg |
192 | 194 | @click.option( |
193 | | - "--path", help="File path. Defaults to the current directory.", default="." |
| 195 | + "--path", |
| 196 | + help="The file path where to save the PDF. Defaults to the current directory.", |
| 197 | + default=os.getcwd(), |
194 | 198 | ) |
195 | 199 | @sdk_options() |
196 | 200 | def export(state, case_number, path): |
|
0 commit comments