soroban-cli: Should output a warning when invoking a contract fn with a parameter named `help`

Open
#365 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
rust
Domain
cli

Research direction

Reproduce the two soroban contract invoke examples and compare their help behavior. Read the dynamic flag naming change in PR 307, then trace the CLI handling for a contract parameter named help. Done means the conflicting -h case emits a warning while the --help invocation continues to work.

Written by the indexing model from the issue text.

Description

bug

Because of the dynamic flag naming introduced in https://github.com/stellar/soroban-tools/pull/307, when you have a contract with a parameter named help, for example:

fn hello(env: Env, help: Symbol) -> Vec<Symbol>

The method prevents the normal -h help text from outputting.

$ soroban contract invoke --id 1 --fn hello -- --help "foo" # works fine
$ soroban contract invoke --id 1 --fh hello -- -h # fails

Pretty rare edge case tbh, but we should at least output a warning when we are in that situation, so that people can tell what is happening.

Dominant language
Rust
Stars
123
Forks
141
Avg merge
2d 21h
Merged PRs (30d)
17

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from stellar/stellar-cli

All issues in stellar/stellar-cli

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.