How to pass cli argument from Clap into Rockets config #2632
Unanswered
wimvelzeboer
asked this question in
Questions
Replies: 1 comment
-
See custom providers. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I am using Clap to capture cli arguments, something like the port which Rocket need to use.
In my clap routing I collect the desired port number, and from there I call the
main
method to launch the Rocket.I would like to pass the port number as parameter into the main method but that is not possible.
What would be the best approach to combine Clap with Rocket, where Clap can be used to collect all sorts of configuration settings to be used in Rocket.
And another thing, I only want to launch Rocket when certain cli arguments are used, so not in all cases. So that I can do something like:
Beta Was this translation helpful? Give feedback.
All reactions