Skip to content

Commit 8d73eab

Browse files
committed
projects no longer requires -p and -f for project id and files
1 parent 9afc10c commit 8d73eab

File tree

2 files changed

+18
-13
lines changed

2 files changed

+18
-13
lines changed

readme.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,22 +109,25 @@ The `analyze` command takes care of several actions for you:
109109

110110
## Arguments and Options
111111

112-
- `-p, --project-id <ID>` Specify which Code Dx project you want to upload files to, by its ID.
112+
```text
113+
analyze [OPTIONS] <PROJECT ID> <FILE(S)...>
114+
```
115+
116+
- `-n, --name <NAME>` Optionally specify a name for the analysis.
117+
- `<PROJECT ID>` Specify which Code Dx project you want to upload files to, by its ID.
113118
(Note: you can find a project's ID using the [`projects`](#command-projects) command,
114119
or finding the number in the URL when you visit that project in a browser)
115-
- `-n, --name <NAME>` Optionally specify a name for the analysis.
116-
- `-f, --file <FILE(S)>` Specify the path to one or more files that you wish to upload.
117-
Each file is a separate argument, but you only need to give the `-f` flag once.
118-
119-
You *must* provide a project ID, and at least one file.
120+
- `<FILE(S)>` Specify the path to one or more files that you wish to upload.
121+
Each file is a separate argument, separated by a space.
120122

121123
## Example
122124

123125
Suppose I want analyze my "WebGoat" project, which happens to have an ID of `5`:
124126

125127
```text
126-
codedx> analyze -p 5 -f "/path/to/workspace/webgoat-source.zip" "/path/to/workspace/webgoat-classes.zip"
128+
codedx> analyze -n "Hello Analysis" 5 "/path/to/workspace/webgoat-source.zip" "/path/to/workspace/webgoat-classes.zip"
127129
# Started analysis 77 with job id f2f3b8c3-9a2c-4446-9765-e99a6d47e69e
130+
# Set analysis 77's name to "Hello Analysis"
128131
# Polling job completion, iteration 1: status = Running
129132
...omitted for brevity...
130133
# Polling job completion, iteration 13: status = Running
@@ -138,7 +141,11 @@ The `projects` command helps you get a list of all Code Dx projects, or search f
138141

139142
## Arguments and Options
140143

141-
- *no arguments* - Prints a list of all Code Dx projects that you have at least read access to.
144+
```text
145+
projects [OPTIONS]
146+
```
147+
148+
- *if no options* - Prints a list of all Code Dx projects that you have at least read access to.
142149
- `-n, --name <PART OF NAME>` - If this flag is given, it adds search criteria such that matching
143150
projects include `<PART OF NAME>` in their name (case insensitive).
144151
- `-m, --metadata <FIELD> <VALUE>` - If this flag is given, it should be followed a key-value

src/commands.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,7 @@ impl <'a> CommandInner<'a> for AnalyzeCommand {
160160
SubCommand::with_name("analyze")
161161
.about("Analyze some files")
162162
.arg(Arg::with_name("project-id")
163-
.short("p")
164-
.long("project-id")
163+
.index(1)
165164
.value_name("ID")
166165
.required(true)
167166
.takes_value(true)
@@ -174,12 +173,11 @@ impl <'a> CommandInner<'a> for AnalyzeCommand {
174173
.required(false)
175174
)
176175
.arg(Arg::with_name("file")
177-
.short("f")
178-
.long("file")
179-
.value_name("FILE")
176+
.value_name("FILE(S)")
180177
.takes_value(true)
181178
.multiple(true)
182179
.required(true)
180+
.index(2)
183181
)
184182
}
185183

0 commit comments

Comments
 (0)