You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently switched a project from Structopt to Gumdrop and am generally quite happy with the change. However, one thing I've not been able to figure out how to do is to use a const to define a default value.
Essentially, I define a default port and use this in several places in the code:
/// Constant defining Goose's default port when running a Gaggle.constDEFAULT_PORT:&str = "5115";
One of the places I was able to use it with structopt was in defining the default value for a couple of run-time configuration options. Is there any way to do this with gumdrop?
For example, if I try this:
/// Sets port Manager listens on#[options(no_short,default = DEFAULT_PORT, meta = "PORT")]pub manager_bind_port:u16,
I've reworked my codebase so I set defaults manually when not otherwise set, instead of relying on gumdrop for this. It was not because of this issue, it was because I also allow for configurable default overrides. Therefore this issue can be closed if it's not something on the gumdrop roadmap, as this is no longer a concern for me.
I recently switched a project from Structopt to Gumdrop and am generally quite happy with the change. However, one thing I've not been able to figure out how to do is to use a
const
to define adefault
value.Essentially, I define a default port and use this in several places in the code:
One of the places I was able to use it with
structopt
was in defining the default value for a couple of run-time configuration options. Is there any way to do this with gumdrop?For example, if I try this:
I get the following error:
The text was updated successfully, but these errors were encountered: