Skip to content

Make list a first-class verb and reorganize CLI help/docs#14

Merged
RchGrav merged 3 commits intomainfrom
codex/refactor-sigmund-command-and-update-documentation
Feb 25, 2026
Merged

Make list a first-class verb and reorganize CLI help/docs#14
RchGrav merged 3 commits intomainfrom
codex/refactor-sigmund-command-and-update-documentation

Conversation

@RchGrav
Copy link
Owner

@RchGrav RchGrav commented Feb 25, 2026

Motivation

  • Make the list action a proper subcommand (sigmund list) while keeping -l/--list as aliases to align CLI semantics with README examples and tests.
  • Improve discoverability and clarity of the printed help by separating launch usage, command verbs, and switches and by documenting -- as a separator rather than a switch.

Description

  • Add list as a recognized command verb in main() while preserving -l and --list as aliases by updating src/sigmund.c to dispatch on "list" (and -l/--list).
  • Reorganize the built-in usage() text in src/sigmund.c into sections: usage, commands, switches, and a note explaining -- as an argument separator.
  • Update README.md to use sigmund list in examples and to restructure the Command Reference into Start commands, Management commands, and Switches and add the -- note.
  • Update tests in tests/test_sigmund.sh to call list instead of -l so test assertions match the new preferred CLI semantics.

Testing

  • Built the project with make clean && make, which completed successfully.
  • Ran the full test suite with ./tests/test_sigmund.sh, and all tests passed (all test cases printed PASS).

Codex Task

Summary by Sourcery

Promote list to a first-class CLI subcommand and align help text, documentation, and tests with the new command structure.

New Features:

  • Add list as a primary sigmund management command while keeping -l and --list as aliases.

Enhancements:

  • Reorganize CLI usage output into clearer sections for commands, switches, and notes, including guidance on using -- as an argument separator.

Documentation:

  • Update README examples and command reference to use sigmund list, introduce start vs. management command groupings, and document switches and -- behavior.

Tests:

  • Update shell tests to invoke sigmund list instead of -l so they validate the new preferred CLI usage.

@sourcery-ai
Copy link

sourcery-ai bot commented Feb 25, 2026

Reviewer's Guide

This PR promotes list to a first-class subcommand while preserving -l/--list as aliases, reorganizes CLI help and README command documentation into clearer sections (usage/commands/switches and start/management/switches), documents -- as an argument separator, and aligns the test suite with the new preferred sigmund list syntax.

File-Level Changes

Change Details Files
Promote list to a first-class CLI verb while keeping -l/--list as aliases.
  • Extend main() command dispatch to recognize list in addition to -l and --list.
  • Continue routing all three forms (list, -l, --list) to the existing list implementation cmd_list(dir).
  • Ensure no behavior change in the underlying list functionality; only invocation paths are expanded.
src/sigmund.c
Reorganize built-in CLI usage text into structured sections and document -- as an argument separator.
  • Split usage output into usage, commands, switches, and note sections for clearer help formatting.
  • Move list from switch-style help into the commands section and describe -l/--list as aliases under switches.
  • Add a note explaining sigmund -- <cmd...> for running commands whose names overlap with subcommands (with sigmund -- list example).
src/sigmund.c
Align README examples and command reference with sigmund list and the new documentation structure.
  • Update all README examples to use sigmund list instead of sigmund -l.
  • Refactor the Command Reference section into Start commands, Management commands, and Switches.
  • Move list into Management commands and list -l/--list as a Switch alias, and add a note explaining -- as an argument separator.
README.md
Update shell tests to prefer list subcommand over -l while keeping semantics identical.
  • Replace "$SIGMUND_BIN" -l invocations with "$SIGMUND_BIN" list in lifecycle, fast-exit, and record-handling tests.
  • Keep all test assertions and expectations the same so tests validate the unchanged list behavior via the new invocation path.
  • Ensure corrupt-record and invalid-pgid tests still call the list functionality and validate logging/output unchanged.
tests/test_sigmund.sh

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • In usage() the --tail behavior is described both under the top-level usage block and again under switches as a launch option; consider tightening this wording to more clearly distinguish the start-command forms from the switches and avoid potential confusion about whether --tail is a subcommand or a flag.
  • In the README Switches table, the --tail description is self-referential ("Equivalent to sigmund --tail <cmd...>"); you might rephrase this to describe what it does (e.g., "Launch and immediately stream command log output") to be consistent with the wording used elsewhere.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `usage()` the `--tail` behavior is described both under the top-level usage block and again under `switches` as a launch option; consider tightening this wording to more clearly distinguish the start-command forms from the switches and avoid potential confusion about whether `--tail` is a subcommand or a flag.
- In the README `Switches` table, the `--tail` description is self-referential ("Equivalent to `sigmund --tail <cmd...>`"); you might rephrase this to describe what it does (e.g., "Launch and immediately stream command log output") to be consistent with the wording used elsewhere.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@RchGrav RchGrav merged commit f8b8ad1 into main Feb 25, 2026
18 checks passed
@RchGrav RchGrav deleted the codex/refactor-sigmund-command-and-update-documentation branch February 25, 2026 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant