How do the --lib
and --bin
flags work?
#362
Answered
by
sassman
mscofield0
asked this question in
Q&A
-
Binary projects have a |
Beta Was this translation helpful? Give feedback.
Answered by
sassman
Jul 5, 2021
Replies: 1 comment 1 reply
-
There is this example in the README [package]
# the usual stuff
[dependencies]
{% if crate_type == "bin" %}
structopt = "0.3.21"
{% endif %}
# other general dependencies
{% if crate_type == "bin" %}
[[bin]]
path = "src/main.rs"
name = "{{crate_name}}-cli"
{% endif %} that illustrates the behaviour. So as a template author you can provide both files, and offer both capabilities. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
mscofield0
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is this example in the README
that illustrates the behaviour.
So as a template author you can provide both files, and offer both capabilities.
A user must then delete the not needed file after generating the project.