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

[question] cargo add a dep as [dependencies.$dep-name] in Cargo.toml #681

Closed
alexzanderr opened this issue Mar 29, 2022 · 2 comments
Closed

Comments

@alexzanderr
Copy link

i tried looking in the --help of the cargo add but could find anything on how to add a dependency like this:

[dependencies.doc-comment]
version = "0.3.3"
optional = true

for example i want to add doc-comment like this running this command:

cargo add doc-comment --optional --as-block

is there a way to do that ?

@epage
Copy link
Collaborator

epage commented Mar 29, 2022

There is not.

The challenge is in keeping things focused and not handle every type of formatting decision.

@alexzanderr alexzanderr changed the title [question] cargo add a dev as [dependencies.$dep-name] in Cargo.toml [question] cargo add a dep as [dependencies.$dep-name] in Cargo.toml Mar 29, 2022
@epage
Copy link
Collaborator

epage commented Jul 14, 2022

cargo add has moved to the cargo repo. In doing so, we made the decision to not support customizing the formatting but having a canonical format. Formatting would then be left to a manifest formatting tool, see #728

@epage epage closed this as completed Jul 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants