Refuse bad command-line arguments cleanly

Open Beginner friendly
#266 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
cli

Research direction

Start at main, where the issue says argument parsing uses env::args; inspect how it handles the config path and invalid arguments. Check the existing command-line tests or run tinyobserve with a non-UTF-8 argument and with --config --check. Done means both cases print usage and exit 2 without panicking.

Written by the indexing model from the issue text.

Description

area:ops bug priority:low

As an operator starting tinyobserve by hand,
I want a mistyped command line to print the usage,
so that I never get a crash or a config path that is really a flag.

Acceptance criteria

  • Given an argument that is not valid UTF-8, when tinyobserve starts, then it prints the usage and exits 2 instead of panicking.
  • Given a flag where the config path should be (for example --config --check), when tinyobserve starts, then it prints the usage and exits 2.

Success signal: no panic from argument parsing.
Out of scope: new flags.
Open questions: none.

Technical notes

Found during #259 (PR #265): main uses env::args, which panics on non-UTF-8 input. These problems existed before that PR.

Dominant language
Rust
Stars
0
Forks
0
Avg merge
40m
Merged PRs (30d)
91

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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 jdrouet/tinyobserve

All issues in jdrouet/tinyobserve

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.