Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Flag Translation Guide

Status: Current Last updated: 2026-06-15 13:28 EDT

The original CLAN uses a +flag/-flag syntax that differs from standard CLI conventions. The Rust reimplementation accepts both styles, legacy CLAN flags are automatically rewritten to modern --flag equivalents before parsing.

Complete Flag Mapping

CLAN FlagModern EquivalentMeaning
+t*CHI--speaker CHIInclude speaker
-t*CHI--exclude-speaker CHIExclude speaker
+t%mor--tier morInclude dependent tier
-t%gra--exclude-tier graExclude dependent tier
+t@ID="..."--id-filter "..."Filter by @ID header pattern
+s<word>--include-word (FREQ) / --keyword (KWAL) / --search (COMBO)Search input; the modern flag depends on the command (FREQ filters by word, KWAL’s keyword is --keyword, COMBO’s boolean search is --search). NOTE: the legacy +s rewrite currently maps to --include-word for every command, so for KWAL/COMBO use the modern flag directly.
-s<word>--exclude-word <word>Exclude word
+g<label>--gem <label>Include gem segment
-g<label>--exclude-gem <label>Exclude gem segment
+z25-125--range 25-125Utterance range
+r6--include-retracingsCount retraced material
+u(default behavior)Merge speakers (already default)
+dN--display-mode N (generic) / per-command typed flagDisplay mode, partially landed. Each +dN value is rewritten command-by-command. FREQ +d1 → --word-list-only, +d2 → --format csv, +d3 → --types-tokens-only --format csv, +d4 → --types-tokens-only. COOCCUR +d → --no-frequency-counts. FREQPOS +d → --position-classification second. Other +dN values still fall through to the generic --display-mode N placeholder, which clap does not consume yet (see Phase 3 plan).
+k--plus-k (--case-sensitive alias)Flip the command’s case mode. FREQ, VOCD, and CHIP preserve case by default and fold under +k; KWAL, COMBO, FREQPOS, DIST, and MAXWD fold by default and preserve under +k. Other inherited +k flags may be no-ops; check each command’s parity page.
+fEXT--output-ext EXTOutput file extension, currently non-functional: the rewriter at crates/talkbank-clan/src/clan_args.rs:107 produces --output-ext, but no clap field consumes it. Tracked as Phase 2 of the rewriter-honor plan (blocked on a batch-output prerequisite).
+wN--context-after NContext lines after match
-wN--context-before NContext lines before match

Examples

Speaker Filtering

# Original CLAN: include CHI, exclude MOT
freq +t*CHI -t*MOT file.cha

# Modern equivalent
chatter-clan freq --speaker CHI --exclude-speaker MOT file.cha
# Original CLAN: search for "want" followed by "need". COMBO takes ONE +s and
# joins terms with ^ (multiple +s flags are rejected: "Only one s option").
combo +s"want^need" file.cha

# Modern equivalent
chatter-clan combo --search "want^need" file.cha

Combined Filters

# Original CLAN: CHI speaker, utterances 10-50, include retraced material
freq +t*CHI +z10-50 +r6 file.cha

# Modern equivalent
chatter-clan freq --speaker CHI --range 10-50 --include-retracings file.cha

Notes

  • The +u flag (merge speakers into a single analysis) is the default behavior and is accepted but ignored.
  • Flags are position-independent; they can appear before or after file arguments.
  • Unknown flags that don’t match CLAN patterns pass through unchanged to clap, which will report an error with suggestions.
  • +dN and +k are now partially functional: see the per-command status tables under clan-reference/commands/ for which N values and which commands are wired up. +fEXT is still rewritten by the legacy-flag layer but rejected by clap (no consuming field yet). See migrating-from-clan.md for the same caveats and the rewriter-honor plan that tracks the remaining gaps.