Skip to content

Commit 01b0bbf

Browse files
cgzonesetke
authored andcommitted
Order argument definitions
Order the command line arguments by name to increase maintainability for future additions.
1 parent a9ffc48 commit 01b0bbf

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

src/main.rs

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -221,18 +221,6 @@ fn main() {
221221
.author(crate_authors!())
222222
.version(crate_version!())
223223
.arg_required_else_help(true)
224-
.arg(
225-
Arg::new("file")
226-
.short('f')
227-
.long("file")
228-
.value_name("FILE")
229-
.help("Target file")
230-
.takes_value(true)
231-
.conflicts_with("directory")
232-
.conflicts_with("pid")
233-
.conflicts_with("process")
234-
.conflicts_with("process-all"),
235-
)
236224
.arg(
237225
Arg::new("directory")
238226
.short('d')
@@ -245,6 +233,18 @@ fn main() {
245233
.conflicts_with("process")
246234
.conflicts_with("process-all"),
247235
)
236+
.arg(
237+
Arg::new("file")
238+
.short('f')
239+
.long("file")
240+
.value_name("FILE")
241+
.help("Target file")
242+
.takes_value(true)
243+
.conflicts_with("directory")
244+
.conflicts_with("pid")
245+
.conflicts_with("process")
246+
.conflicts_with("process-all"),
247+
)
248248
.arg(
249249
Arg::new("json")
250250
.short('j')
@@ -255,7 +255,7 @@ fn main() {
255255
Arg::new("maps")
256256
.short('m')
257257
.long("maps")
258-
.help("Include process memory maps (linux only)")
258+
.help("Include process memory maps (Linux only)")
259259
.requires("process")
260260
.requires("process-all"),
261261
)
@@ -264,6 +264,20 @@ fn main() {
264264
.long("no-color")
265265
.help("Disables color output"),
266266
)
267+
.arg(
268+
Arg::new("pid")
269+
.long("pid")
270+
.value_name("PID")
271+
.help(
272+
"Process ID of running process to check\n\
273+
(comma separated for multiple PIDs)",
274+
)
275+
.takes_value(true)
276+
.conflicts_with("directory")
277+
.conflicts_with("file")
278+
.conflicts_with("process")
279+
.conflicts_with("process-all"),
280+
)
267281
.arg(
268282
Arg::new("pretty")
269283
.long("pretty")
@@ -282,20 +296,6 @@ fn main() {
282296
.conflicts_with("pid")
283297
.conflicts_with("process-all"),
284298
)
285-
.arg(
286-
Arg::new("pid")
287-
.long("pid")
288-
.value_name("PID")
289-
.help(
290-
"Process ID of running process to check\n\
291-
(comma separated for multiple PIDs)",
292-
)
293-
.takes_value(true)
294-
.conflicts_with("directory")
295-
.conflicts_with("file")
296-
.conflicts_with("process")
297-
.conflicts_with("process-all"),
298-
)
299299
.arg(
300300
Arg::new("process-all")
301301
.short('P')

0 commit comments

Comments
 (0)