Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI: invoke panicks when no -- included #999

Closed
leighmcculloch opened this issue Oct 4, 2023 · 4 comments · Fixed by #1068
Closed

CLI: invoke panicks when no -- included #999

leighmcculloch opened this issue Oct 4, 2023 · 4 comments · Fixed by #1068
Labels
bug Something isn't working

Comments

@leighmcculloch
Copy link
Member

leighmcculloch commented Oct 4, 2023

What version are you using?

soroban version
soroban 20.0.0-rc3 (7cc2f46b4b83a94375e33f738d30f0bb824ea9a5)
soroban-env 20.0.0-rc2 (8c63bff68a15d79aca3a705ee6916a68db57b7e6)
soroban-env interface version 85899345977
stellar-xdr 20.0.0-rc1 (d5ce0c9e7aa83461773a6e81662067f35d39e4c1)
xdr curr (9ac02641139e6717924fdad716f6e958d0168491)

What did you do?

Ran the contract invoke sub command without any parameters other than the contract ID:

SOROBAN_RPC_URL=... SOROBAN_NETWORK_PASSPHRASE=... soroban contract invoke --id C...

What did you expect to see?

I expected to see some default help output, as if I had run the command with -- --help:

SOROBAN_RPC_URL=... SOROBAN_NETWORK_PASSPHRASE=... soroban contract invoke --id C... -- --help
Usage: C... [COMMAND]

Commands:
  counter  
  count    
  help     Print this message or the help of the given subcommand(s)

Options:
  -h, --help  Print help

What did you see instead?

A panick.

SOROBAN_RPC_URL=... SOROBAN_NETWORK_PASSPHRASE=... soroban contract invoke --id C...
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /Users/leighmcculloch/.cargo/registry/src/index.crates.io-6f17d22bba15001f/soroban-cli-20.0.0-rc3/src/commands/contract/invoke.rs:188:66
@leighmcculloch leighmcculloch added the bug Something isn't working label Oct 4, 2023
@willemneal
Copy link
Member

I've also been considering making the generated cli interactive.

@leighmcculloch
Copy link
Member Author

leighmcculloch commented Oct 4, 2023

That would be very cool, although that wouldn't need to be mutually exclusive with the existing UI. The existing UI is particularly useful in scripts, so I think there's strong value in retaining it and adding an interactive API in addition? I imagine both can be powered by much of the same logic.

@willemneal
Copy link
Member

Yeah I've also had some issues in some shells, when using the clap interactive crate. Still seems like an easy addition that would be none breaking since the normal CLI is still available.

@willemneal
Copy link
Member

I looked more into this and the tools that I found for generating an interactive prompt all use derive and not a builder. So while I would still like to find a way to do it interactively it's not as easy as I had hoped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants