String arguments need weird double quote combination to work: '"<string>"'
In order to instantiate a contract with argument String I need to wrap the string in the terminal with '", example:
--args '"argument"'
We have a similar issue opened by a user in pop-cli https://github.com/r0gue-io/pop-cli/issues/408
➜ inputs cargo contract instantiate --suri //Alice --args false "value" -x
ERROR: Expected a String value
On the command-line, String values need to be wrapped in escaped quotes: \"…\".
@cmichi was there a reason not to have it under \"
So this behavior goes back to how bash treats double quotes. Before passing arguments to a command, bash will remove the double quotes. It's why things like rm "foo" also work.
In our case, cargo-contract never sees the "value" from cargo contract instantiate -args "value", but just value. The easy solution is to escape it, then cargo-contract (or rather the crate parsing the commandline args) knows it's a string.
I also think this should be done better, but it's likely not a straight forward issue. I believe the most intuitive solution would be to also support --args 'my argument', but --args "my argument" will likely never work (as the process just sees --args my argument).