Skip to content

Improve CLI parameter validation errors #4903

@masklinn

Description

@masklinn

These are minor QOL issues but following seeing https://www.reddit.com/r/rust/comments/7o3sgg/how_to_use_the_name_option_with_cargo/ I tried:

> cargo new --bin --name 01-init-instance
error: Invalid arguments.

Usage:
    cargo new [options] <path>
    cargo new -h | --help

The error message is unclear, the Usage section obliquely hints at the issue but the requirement of an FS path could be spelled out more clearly.

> cargo new --bin --name 01-init-instance a
error: Package names starting with a digit cannot be used as a crate name
use --name to override crate name

The error itself is correct, but the suggestion is not.

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