-
Notifications
You must be signed in to change notification settings - Fork 35
Conversation
#[derive(Debug, StructOpt)] | ||
#[structopt(name = "iml", setting = structopt::clap::AppSettings::ColoredHelp)] | ||
/// The Integrated Manager for Lustre CLI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could not come up with a generic non-trivial description :)
f516115
to
9bdf41d
Compare
9bdf41d
to
30e2182
Compare
General question: what happens if the structopt name does not match the binary name? I.E. if we had a binary called |
I think nothing. The binary name is totally unrelated to the actually running code. |
So in the case above it would print |
Yes. |
Ok, so in that case we will want to have an environment variable to name the cli. It should default to |
30e2182
to
059ef4b
Compare
These parts look interesting: https://github.com/clap-rs/clap/blob/3e9ee86713b5c407b50ba76f30cffaed25952063/src/output/usage.rs#L48-L53 |
Can we reach into clap and set |
This will be let matches = App::from_clap(
&App::clap()
.bin_name("fffffffffff")
.name("wwwwwww")
.get_matches(),
); But if we don't rename the binary and use some script, e. g.
we may have some issues anyway, for example:
|
2300b58
to
95d693a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 5 files at r1, 8 of 8 files at r3.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @ip1981)
iml-manager-cli/src/config-main.rs, line 28 at r3 (raw file):
iml_tracing::init(); let name = selfname(Some("config")).unwrap_or_else(|| "iml-config".to_string());
Would it make sense to move the default into selfname
so that it concatenates iml-
to whatever comes in Option
?
iml-manager-cli/src/lib.rs, line 32 at r2 (raw file):
Previously, ip1981 (Igor Pashev) wrote…
What about this:
pub fn selfname(suffix: Option<&str>) -> Option<String> { // get var // build with optional suffix (specific to the executable) // default to executable name }
I like
95d693a
to
a5af052
Compare
- Determine executable name. - Remove "IML" where possbile. Signed-off-by: Igor Pashev <pashev.igor@gmail.com>
a5af052
to
a2ed52e
Compare
Determine executable name.
Remove "IML" where possbile.
Separate packages would create a hard link for the executable and symlinks for shell completions.
Closes #2295.
Signed-off-by: Igor Pashev pashev.igor@gmail.com
This change is