Lay3rLabs / avs-toolkit

MIT License
6 stars 3 forks source link

CLI does not support `--target` flag for subcommands #61

Closed calvinrp closed 1 month ago

calvinrp commented 1 month ago

We need the subcommands to support the --target to switch between the local and test.

Typically a good way to do this is a struct CommonArgs and then use a flatten to put in the subcommand arg structs.

https://github.com/Lay3rLabs/avs-toolkit/blob/main/tools/cli/src/args.rs#L12-L14

calvinrp commented 1 month ago

Nevermind, it works. But it is order dependent...

Confirmed the behavior after I modified the default to TestNet.

avs-toolkit-cli --target local deploy contracts --artifacts-path ./artifacts --operators wasmatic vs. avs-toolkit-cli deploy contracts --artifacts-path ./artifacts --operators wasmatic --target local

So you need to supply the top-level args first, otherwise it will give you an error that the flag is not supported: error: unexpected argument '--target' found

Top-level args: https://github.com/Lay3rLabs/avs-toolkit/blob/main/tools/cli/src/args.rs#L12-L37