Skip to content

fix: explain how to pass an ID that starts with '-' - #62

Merged
marevol merged 1 commit into
mainfrom
fix/dash-leading-id
Nov 27, 2026
Merged

marevol merged 1 commit into
mainfrom
fix/dash-leading-id

Conversation

@marevol

@marevol marevol commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Fess IDs are URL-safe Base64, so an ID can start with -. Such an ID is read as options: fessctl keymatch update -abcDEF --max-size 3 fails with No such option: -a. Putting the options first and -- before the ID (fessctl keymatch update --max-size 3 -- -abcDEF) already works, since that is how Click separates positional arguments from options, but only the skill docs mentioned it, and the error points users at --help, which did not.

The commands keep the positional ID; conventions.md documents that no subcommand takes --id, so this PR makes the existing form discoverable instead of adding a second way to pass the ID:

  • A shared id_help() in utils.py appends "If the ID starts with '-', give the options first, then '--' and the ID." to the help text of every positional ID argument (118 commands, including the dict and scheduler start/stop commands). Behaviour is unchanged.
  • README notes the -- form under Usage, and troubleshooting.md has an entry for the No such option: -a error.

Tests

  • New tests/unit/test_dash_leading_id.py, built from the root Typer app so it covers every command with an ID argument: --help shows the hint (118 cases, all fail without the change), the -- form parses -abcDEF as the ID (118 cases), keymatch update sends the ID to the API unchanged, and the bare form still fails with No such option.
  • Unit suite: 1862 passed.

Fess IDs are URL-safe Base64, so an ID can start with '-'. The parser
then reads it as options ("No such option: -a"). Passing it after '--'
already works, but nothing outside the skill docs said so.

Every positional ID argument now gets its help text from a shared
id_help() helper that says to give the options first, then '--' and the
ID. README and the troubleshooting reference describe the same form.
@marevol marevol self-assigned this Nov 27, 2026
@marevol marevol added this to the 0.5.0 milestone Nov 27, 2026
@marevol
marevol merged commit 296245c into main Nov 27, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant