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

Automatically replace dashes - with underscores _ in example names, if necessary #18

Open
rnag opened this issue Apr 17, 2022 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@rnag
Copy link
Owner

rnag commented Apr 17, 2022

Is your feature request related to a problem? Please describe.

It would be cool if we can automatically replace dashes - with underscores _ (or vice versa) if we determine that a user-entered example name with dashes - is not a valid example, but that it would be instead valid with _.

The main impetus for this is that it is somewhat easier to type a dash - on a keyboard - don't need to make a beeline for the shift key, for example. 🤔

Describe the solution you'd like

Current output when running cargo run --example, when mis-typing _ as - for instance:

PS serde-this-or-that> cargo run --example as-string
error: no example target named `as-string`

        Did you mean `as_string`?

Desired output:

PS serde-this-or-that> rx as-string

>> cargo run --example as_string
[result of running the `as_string` example]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant