Skip to content

--host flag wants registry index URL, not registry website host #3797

Closed
@carols10cents

Description

@carols10cents

If I do cargo publish --help, I see this documentation for the --host flag:

--host HOST              Host to upload the package to

If I wanted to upload to the staging instance of crates.io at https://staging-crates-io.herokuapp.com/, the name of this flag and the docs make me think I should specify --host staging-crates-io.herokuapp.com here. This does not publish to the staging instance, however.

By digging into the code, I've figured out that what this flag actually wants is the location of the index to which I want to publish:

When I'm running crates.io locally, i'm able to publish to my local instance by giving cargo --host=file:///path/to/crates.io/tmp/index-co/. I'm able to get to a sort-of-working point with staging crates.io by specifying --host=https://github.com/alexcrichton/cargo-registry-index.

So I think that --host should be renamed to --index-url, or at the very least, the documentation in all the commands that use --host should explain that it should be a URL to the index you want to publish to.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions