Skip to content

Add input/output descriptions to --help for 95 CLI scripts#18

Open
olsonanl wants to merge 1 commit into
BV-BRC:masterfrom
olsonanl:feature/input-mode-in-help
Open

Add input/output descriptions to --help for 95 CLI scripts#18
olsonanl wants to merge 1 commit into
BV-BRC:masterfrom
olsonanl:feature/input-mode-in-help

Conversation

@olsonanl

@olsonanl olsonanl commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds Input/Output/Example lines to --help output for 95 p3- scripts
  • Clarifies for each script whether it reads from stdin, command-line arguments, files, or a combination
  • Covers all three input patterns:
    • CLI-only queries: p3-all-*, p3-find-serology-data, etc. — "Input: none (queries BV-BRC database directly)"
    • Stdin pipeline: p3-get-*, p3-find-features, data utilities — "Input: tab-delimited genome IDs on stdin (or --input file)"
    • Dual-mode: p3-gto, p3-dump-genomes — "Input: genome IDs as arguments, or - to read from stdin"

Depends on P3Utils::input_spec() from p3_core PR: BV-BRC/p3_core#20

Motivation

Users frequently struggle with understanding which scripts read from stdin vs command-line arguments, and how to compose them into pipelines. This adds the answer directly to --help where they look first.

Example

$ p3-get-genome-features --help

  Input:   tab-delimited genome IDs on stdin (or --input file)
  Output:  tab-delimited feature data
  Example: p3-all-genomes --eq genus,Methylobacillus | p3-get-genome-features --attr patric_id --attr product

p3-get-genome-features.pl [-abcefhiKr] [long options...]
  ...

Scripts not modified (3)

p3-aggregates-to-html, p3-project-subsystems, p3-make-genome-list-blast-database — these don't use P3Utils::script_opts() and need individual handling.

Test plan

  • Spot-checked --help output for scripts from each category
  • All 95 modified scripts produce valid help output
  • Unmodified scripts still work unchanged

🤖 Generated with Claude Code

Each script's --help now shows Input, Output, and Example lines
before the options list, clarifying whether the script reads from
stdin, command-line arguments, or both. Covers all three input
patterns:

  - CLI-only queries (p3-all-*, p3-find-serology-data, etc.)
  - Stdin pipeline (p3-get-*, p3-find-features, data utilities)
  - Dual-mode (p3-gto, p3-dump-genomes: args or - for stdin)

Uses P3Utils::input_spec() added in p3_core.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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