Skip to content

Conversation

omskscream
Copy link

@omskscream omskscream commented Sep 21, 2025

What does this PR try to resolve?

Came up in #15274 to avoid putting tokens into a shell history for publish command.
Implemented similar to #15057

This PR deprecates the optional argument in cargo publish, meaning:

  • Remove the mention of the argument from cargo publish help text and doc.
  • Give a warning when the argument is used
     `cargo publish --token <token>` is deprecated in favor of reading `<token>` from stdin.
    
  • add an stdin read for token of the argument is missing

Came up in rust-lang#15274 to avoid putting tokens into a shell history for `publish` command as well as login.
@rustbot
Copy link
Collaborator

rustbot commented Sep 21, 2025

r? @epage

rustbot has assigned @epage.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-cli Area: Command-line interface, option parsing, etc. A-cli-help Area: built-in command-line help A-documenting-cargo-itself Area: Cargo's documentation A-interacts-with-crates.io Area: interaction with registries Command-publish S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 21, 2025
@omskscream omskscream changed the title Publish warn token fix(publish): deprecate CLI token Sep 21, 2025
remove deprecated `--token` option from docs
@epage
Copy link
Contributor

epage commented Sep 22, 2025

There are two changes here

  • Read tokens from stdin
  • Deprecate --token

Ideally this would be structured as at least two commits. More likely, these should be separate PRs to get the appropriate level of attention to each.

@omskscream
Copy link
Author

Thanks for the comment! Valid point, I thought about separate PRs too. I'll close this one and will recreate changes in separate pull requests.

@omskscream omskscream closed this Sep 22, 2025
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cli Area: Command-line interface, option parsing, etc. A-cli-help Area: built-in command-line help A-documenting-cargo-itself Area: Cargo's documentation A-interacts-with-crates.io Area: interaction with registries Command-publish
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants