Open rocky opened 5 years ago
I don't see anywhere documented the format of plugin's positional arguments and optional flags (keys).
Right now I can run plugin as follows: truffle run my-plugin foo bar baz
and config._
contains array ['foo', 'bar', 'baz']
.
When I run truffle run my-plugin foo bar baz --debug
config
looks like
{
_: ['foo', 'bar', 'baz'],
debug: true,
}
When I run truffle run my-plugin --debug foo bar baz
config
looks like
{
_: ['bar', 'baz'],
debug: 'foo',
}
But what I wanted is to have ['foo', 'bar', 'baz'] as positional arguments and debug being true
The same thing happend when I used -d
instead of --debug
. I got:
{
_: ['bar', 'baz'],
d: 'foo',
}
It would be neat to be able to pass flags with and without arguments.
This is probably somewhat related to #1473, linking so it's easier to find.
If I am using a run plugin, how do I let truffle know which options take parameters and which don't?