Skip to content

Commit

Permalink
cargo-*: add page; cargo-logout: update page (tldr-pages#11337)
Browse files Browse the repository at this point in the history
Co-authored-by: Juri Dispan <[email protected]>
  • Loading branch information
acuteenvy and gutjuri authored Oct 31, 2023
1 parent e564962 commit 02c7e38
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 1 deletion.
13 changes: 13 additions & 0 deletions pages/common/cargo-login.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# cargo login

> Save an API token from the registry locally.
> The token is used to authenticate to a package registry. You can remove it using `cargo logout`.
> More information: <https://doc.rust-lang.org/cargo/commands/cargo-login.html>.
- Add an API token to the local credential storage (located in `$CARGO_HOME/credentials.toml`):

`cargo login`

- Specify the name of the registry to use (registry names can be defined in the config - the default is <https://crates.io>):

`cargo login --registry {{name}}`
3 changes: 2 additions & 1 deletion pages/common/cargo-logout.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# cargo logout

> Remove an API token from the registry locally.
> The token is used to authenticate to a package registry. You can add it back using `cargo login`.
> More information: <https://doc.rust-lang.org/cargo/commands/cargo-logout.html>.
- Remove the API token from the local credential storage:
- Remove an API token from the local credential storage (located in `$CARGO_HOME/credentials.toml`):

`cargo logout`

Expand Down
20 changes: 20 additions & 0 deletions pages/common/cargo-owner.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# cargo owner

> Manage the owners of a crate on the registry.
> More information: <https://doc.rust-lang.org/cargo/commands/cargo-owner.html>.
- Invite the given user or team as an owner:

`cargo owner --add {{username|github:org_name:team_name}} {{crate}}`

- Remove the given user or team as an owner:

`cargo owner --remove {{username|github:org_name:team_name}} {{crate}}`

- List owners of a crate:

`cargo owner --list {{crate}}`

- Specify the name of the registry to use (registry names can be defined in the config - the default is <https://crates.io>):

`cargo owner --registry {{name}}`
13 changes: 13 additions & 0 deletions pages/common/cargo-package.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# cargo package

> Assemble a local package into a distributable tarball (a `.crate` file).
> Similar to `cargo publish --dry-run`, but has more options.
> More information: <https://doc.rust-lang.org/cargo/commands/cargo-package.html>.
- Perform checks and create a `.crate` file (equivalent of `cargo publish --dry-run`):

`cargo package`

- Display what files would be included in the tarball without actually creating it:

`cargo package --list`
17 changes: 17 additions & 0 deletions pages/common/cargo-publish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# cargo publish

> Upload a package to a registry.
> Note: you have to add an authentication token using `cargo login` before publishing a package.
> More information: <https://doc.rust-lang.org/cargo/commands/cargo-publish.html>.
- Perform checks, create a `.crate` file and upload it to the registry:

`cargo publish`

- Perform checks, create a `.crate` file but don't upload it (equivalent of `cargo package`):

`cargo publish --dry-run`

- Specify the name of the registry to use (registry names can be defined in the config - the default is <https://crates.io>):

`cargo publish --registry {{name}}`
17 changes: 17 additions & 0 deletions pages/common/cargo-yank.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# cargo yank

> Remove a pushed crate from the index. This should only be used when you accidentally release a significantly broken crate.
> Note: this does not remove any data. The crate is still present after a yank - this just prevents new projects from using it.
> More information: <https://doc.rust-lang.org/cargo/commands/cargo-yank.html>.
- Yank the specified version of a crate:

`cargo yank {{crate}}@{{version}}`

- Undo a yank (i.e. allow downloading it again):

`cargo yank --undo {{crate}}@{{version}}`

- Specify the name of the registry to use (registry names can be defined in the config - the default is <https://crates.io>):

`cargo yank --registry {{name}} {{crate}}@{{version}}`

0 comments on commit 02c7e38

Please sign in to comment.