Running `clarity-cli eval` hangs on invalid arguments instead of failing
When running clarity-cli eval with invalid arguments, the command hangs instead of returning an error:
$ clarity-cli eval --help
Usage: ./target/release/clarity-cli eval [--costs] [contract-identifier] (program.clar) [vm-state.db]
$ clarity-cli eval SP123 1.clar
# hangs forever
This happens because the binary tries to open a database using the contract identifier. The expected behavior is that the CLI should only try to open a VM state DB if one is provided. Otherwise, it should fail with an error.
It turns out it's not really hanging, it's waiting for you to send something to standard input. This isn't really obvious though.
This is addressed in #6738. See the PR description for details. With that change, your call with invalid arguments will indeed fail with an error (because it tries to open 1.clar as a a DB).
Thanks @benjamin-stacks! 🙏