# shellcheck shell=bash

gwr_show_usage() {
    cat << EOF
gwr - Git Worktree Rust TUI

Usage: gwr [options]

A terminal user interface for managing git worktrees and tmux sessions.

Options:
  -d, --debug      Enable debug mode
  --new-tmux       Create and attach to a new tmux session for the current branch
  --cmd <command>  Run a command in the new tmux session (repeatable; requires --new-tmux)
  -h, --help       Show this help
  --check-updates  Check for available updates
  --update         Check for available updates (alias for --check-updates)

Features:
  • Interactive worktree and session management
  • Visual tree display of worktrees and their tmux sessions  
  • Real-time session previews and git status
  • Keyboard navigation with vim-like bindings
  • Session creation, deletion, and renaming
  • AI-powered session naming (when configured)

Navigation:
  ↑/↓             Navigate items
  Enter           Select worktree or attach to session
  s               Auth menu (if enabled)
  Space           Expand/collapse worktree sessions
  d               Delete worktree or kill session
  r               Rename session (AI-powered)
  c               Create new worktree
  o               Configure AI keys and provider
  Ctrl+R          Refresh data
  q/Esc           Quit

Requirements:
  • Git repository
  • Rust TUI binary (built with build.sh)
  • gw-bridge.sh script
  • tmux (optional, for session management)

For the original shell-based interface, use: gw

Examples:
  gwr             # Launch interactive TUI
  gwr --new-tmux  # Start a new tmux session for the current branch
  gwr --new-tmux --cmd "pnpm install" --cmd "pnpm dev"
  gwr --debug     # Launch with debug information
  gwr --help      # Show this help
  gwr --update    # Check for available updates

EOF
}
