Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkgid cmd: fix help msg with multiple packages #3149

Merged
merged 1 commit into from
Oct 18, 2016

Conversation

cardoe
Copy link
Contributor

@cardoe cardoe commented Oct 2, 2016

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 cardoe@cardoe.com

@rust-highfive
Copy link

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@@ -139,8 +139,8 @@ impl PackageIdSpec {
your project, and the specification \
`{}` is ambiguous.\n\
Please re-run this command \
with `-p <spec>` where `<spec>` is one \
of the following:",
with is one of the following as \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be missing the "``-p where`" part?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or, rather, the -p part.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the point.

$ cargo pkgid uuid                                                      101 ↵
error: There are multiple `uuid` packages in your project, and the specification `uuid` is ambiguous.
Please re-run this command with `-p <spec>` where `<spec>` is one of the following:
  uuid:0.3.1
  uuid:0.2.3
$ cargo pkgid -p uuid:0.3.1                                             101 ↵
error: Unknown flag: '-p'

Usage:
    cargo pkgid [options] [<spec>]
$ cargo pkgid uuid:0.3.1                                                  1 ↵
https://github.com/rust-lang/crates.io-index#uuid:0.3.1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Further more from Cargo 0.13.0

$ cargo pkgid --help
Print a fully qualified package specification

Usage:
    cargo pkgid [options] [<spec>]

Options:
    -h, --help               Print this message
    --manifest-path PATH     Path to the manifest to the package to clean
    -v, --verbose ...        Use verbose output
    -q, --quiet              No output printed to stdout
    --color WHEN             Coloring: auto, always, never
    --frozen                 Require Cargo.lock and cache are up to date
    --locked                 Require Cargo.lock is up to date

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see now. I didn't connect that the -p doesn't work. No idea how I missed that in the description, sorry.

@alexcrichton
Copy link
Member

Thanks for the report! Perhaps though the -p argument could be added to cargo pkgid for consistency? This is pretty critical information for other commands like cargo build or cargo update, so I'd prefer to not lose the suggestion of -p where it's correct there.

@cardoe
Copy link
Contributor Author

cardoe commented Oct 3, 2016

Yeah we can do that.

When you use this command and there are multiple packages that match
this spec, the help instructions tell you to rerun it with the -p
argument which was previously not present. Since the code paths are
shared with 'cargo build' and 'cargo update', this adds the -p argument
to 'cargo pkgid' to make things more consistent.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
@cardoe
Copy link
Contributor Author

cardoe commented Oct 18, 2016

@alexcrichton This should be good for another peek. I aimed to retain backwards compatibility for people that might have scripts that don't use the -p argument.

@alexcrichton
Copy link
Member

@bors: r+

Thanks!

@bors
Copy link
Contributor

bors commented Oct 18, 2016

📌 Commit 1e7893c has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Oct 18, 2016

⌛ Testing commit 1e7893c with merge 02fed69...

bors added a commit that referenced this pull request Oct 18, 2016
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 <cardoe@cardoe.com>
@bors
Copy link
Contributor

bors commented Oct 18, 2016

☀️ Test successful - cargo-cross-linux, cargo-linux-32, cargo-linux-64, cargo-mac-32, cargo-mac-64, cargo-win-gnu-32, cargo-win-gnu-64, cargo-win-msvc-32, cargo-win-msvc-64
Approved by: alexcrichton
Pushing 02fed69 to master...

@bors bors merged commit 1e7893c into rust-lang:master Oct 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants