Hi, I'm trying to add a default value to the flag --foo when the shell is set to nushell and I want this default value to be dependent of what the user entered as name
I looked at the documentation for quite some times without finding anything like that, therefore I came here to ask for help
you will see that the value should be something implementing IntoResettable<OsStr> and in the end that is not implemented for String (even if the interpolation of self.name would work, and I don't think it would).
Why don't you just do:
let foo = match args.shell {
Shell::Nu => Some(args.name),
_ => None
};