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

cargo help config doesn't recognize config command #11408

Closed
TimJentzsch opened this issue Nov 22, 2022 · 1 comment
Closed

cargo help config doesn't recognize config command #11408

TimJentzsch opened this issue Nov 22, 2022 · 1 comment
Labels
A-cli-help Area: built-in command-line help A-documenting-cargo-itself Area: Cargo's documentation C-bug Category: bug Z-cargo-config Nightly: cargo config subcommand

Comments

@TimJentzsch
Copy link

TimJentzsch commented Nov 22, 2022

Problem

Confusing output when running cargo help config:

$ cargo help config
error: no such subcommand: `config`

	Did you mean `config`?

	View all installed commands with `cargo --list`

Steps

  1. Run cargo help config

Possible Solution(s)

There doesn't seem to be a man page for cargo config: https://github.com/rust-lang/cargo/tree/master/src/doc/man

This results in extract_man to return None, which results in try_help returning Ok(false):

let man = match extract_man(subcommand, "1") {
Some(man) => man,
None => return Ok(false),

This in turn makes exec return the confusing message:

if !try_help(config, subcommand)? {
crate::execute_external_subcommand(
config,
subcommand,
&[OsStr::new(subcommand), OsStr::new("--help")],
)?;

I'd propose the following fixes:

  1. Differentiate between the command not being found and the man page not being found. If the man page couldn't be found, a different message should be returned.
  2. Add the man page for cargo config.

Notes

No response

Version

cargo 1.65.0 (4bc8f24d3 2022-10-20)
release: 1.65.0
commit-hash: 4bc8f24d3e899462e43621aab981f6383a370365
commit-date: 2022-10-20
host: x86_64-unknown-linux-gnu
libgit2: 1.5.0 (sys:0.15.0 vendored)
libcurl: 7.83.1-DEV (sys:0.4.55+curl-7.83.1 vendored ssl:OpenSSL/1.1.1q)
os: Pop!_OS 22.04 (jammy) [64-bit]
@TimJentzsch TimJentzsch added the C-bug Category: bug label Nov 22, 2022
@ehuss ehuss added A-documenting-cargo-itself Area: Cargo's documentation Z-cargo-config Nightly: cargo config subcommand A-cli-help Area: built-in command-line help labels Nov 22, 2022
@weihanglo
Copy link
Member

I would say #11473 fixes this issue. We could track manpage for cargo config and its nested subcommands in #9301. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cli-help Area: built-in command-line help A-documenting-cargo-itself Area: Cargo's documentation C-bug Category: bug Z-cargo-config Nightly: cargo config subcommand
Projects
None yet
Development

No branches or pull requests

3 participants