The argument parsing doesn't check if a value was actually provided

Open
#878 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
docker, shell
Domain
cli

Research direction

Locate the shell argument-parsing entry point used by the Docker quickstart command and inspect how options such as --enable consume their following argument. Reproduce the command with --enable --local, then verify that every option requiring a value rejects a missing value and reports an error instead of treating the next option as that value.

Written by the indexing model from the issue text.

Description

The argument parsing doesn't check if a value was actually provided.

For example, if someone runs docker run stellar/quickstart --enable --local, the code will incorrectly set ENABLE to --local instead of catching the missing value.

We could add a check like:

if [[ -z "$1" || "$1" == --* ]]; then
  echo "Error: --enable requires a value" >&2
  exit 1
fi

The above is an example, but could be applied to other options that accept a parameter.

Originally posted by @Copilot in https://github.com/stellar/quickstart/pull/877#discussion_r2667213722

Dominant language
Shell
Stars
222
Forks
236
Avg merge
1d 12h
Merged PRs (30d)
12

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/quickstart

All issues in stellar/quickstart

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.