Skip to content

Commit 02fed69

Browse files
authored
Auto merge of #3149 - cardoe:fix-pkgid-cmd, r=alexcrichton
pkgid cmd: fix help msg with multiple packages When there are multiple versions of a package that match a given spec the command tells you to re-run it with the `-p` argument which does not exist. The command appears to work without it properly. Signed-off-by: Doug Goldstein <[email protected]>
2 parents 305621d + 1e7893c commit 02fed69

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/bin/pkgid.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ pub struct Options {
1111
flag_manifest_path: Option<String>,
1212
flag_frozen: bool,
1313
flag_locked: bool,
14+
flag_package: Option<String>,
1415
arg_spec: Option<String>,
1516
}
1617

@@ -22,6 +23,7 @@ Usage:
2223
2324
Options:
2425
-h, --help Print this message
26+
-p SPEC, --package SPEC Argument to get the package id specifier for
2527
--manifest-path PATH Path to the manifest to the package to clean
2628
-v, --verbose ... Use verbose output
2729
-q, --quiet No output printed to stdout
@@ -60,7 +62,14 @@ pub fn execute(options: Options,
6062
let root = try!(find_root_manifest_for_wd(options.flag_manifest_path.clone(), config.cwd()));
6163
let ws = try!(Workspace::new(&root, config));
6264

63-
let spec = options.arg_spec.as_ref().map(|s| &s[..]);
65+
let spec = if options.arg_spec.is_some() {
66+
options.arg_spec
67+
} else if options.flag_package.is_some() {
68+
options.flag_package
69+
} else {
70+
None
71+
};
72+
let spec = spec.as_ref().map(|s| &s[..]);
6473
let spec = try!(ops::pkgid(&ws, spec));
6574
println!("{}", spec);
6675
Ok(None)

0 commit comments

Comments
 (0)