//! Common CLI patterns and help text for all typedialog binaries

/// Long help for typedialog (CLI) main command
pub const CLI_MAIN_LONG_ABOUT: &str = r#"typedialog - Interactive forms and prompts with multiple backends.

Use typedialog with different backends for various use cases:

BACKENDS (run with -h for full options):
  form              CLI backend - Step-by-step interactive prompts (default, scriptable)
                    Run: typedialog form config.toml -h

  web               Web backend - Browser-based forms (best for teams)
                    Run: typedialog web form config.toml --port 8080
                    For options: typedialog web -h

  tui               TUI backend - 3-panel terminal UI (best for interactive use)
                    Run: typedialog tui config.toml
                    For options: typedialog tui -h

  ai                AI backend - AI-powered configuration assistant
                    Run: typedialog ai serve
                    For options: typedialog ai -h

  ag                Agent backend - Type-safe AI agents
                    Run: typedialog ag run agent.ncl
                    For options: typedialog ag -h

  prov-gen          Provisioning generator - Generate provisioning structures
                    Run: typedialog prov-gen generate
                    For options: typedialog prov-gen -h

All backends produce identical JSON output from the same TOML form definition.

QUICK START:
  # Interactive forms (CLI - default)
  typedialog form config.toml

  # Run form in terminal UI
  typedialog tui config.toml

  # Run form in web browser
  typedialog web form config.toml --port 8080

ENVIRONMENT VARIABLES:
  TYPEDIALOG_LANG       Locale for form localization (e.g., 'en-US', 'es-ES')
                         Priority: CLI flag > form locale > TYPEDIALOG_LANG > LANG > LC_ALL > default
  TYPEDIALOG_PORT       Port for web backend (default: 9000)
  LANG                   System locale (fallback if TYPEDIALOG_LANG not set)
  LC_ALL                 Alternate locale setting (fallback to LANG)

EXAMPLES:
  # Run form with CLI backend (default)
  typedialog form config.toml

  # Run form with TUI backend
  typedialog tui config.toml

  # Run form with Web backend on port 8080
  typedialog web form config.toml --port 8080

  # AI-powered assistant
  typedialog ai serve

  # Run agent
  typedialog ag run agent.ncl

  # Generate provisioning structure
  typedialog prov-gen generate

  # Use Spanish locale
  TYPEDIALOG_LANG=es-ES typedialog form config.toml

HELP:
  typedialog form -h          Show CLI backend options
  typedialog web -h           Show Web backend options
  typedialog tui -h           Show TUI backend options
  typedialog ai -h            Show AI backend options
  typedialog ag -h            Show Agent backend options
  typedialog prov-gen -h      Show provisioning generator options"#;

/// Long help for typedialog-tui
pub const TUI_MAIN_LONG_ABOUT: &str = r#"typedialog-tui - Terminal UI tool for interactive forms.

Provides an enhanced 3-panel terminal interface (left: field list, right: input editor, bottom: buttons)
with conditional field visibility and smart defaults.

This is the TUI-specific binary. To use TUI backend with typedialog CLI, set:
  TYPEDIALOG_BACKEND=tui typedialog form <config>

Available backends via typedialog main command:
  - typedialog: CLI backend (step-by-step prompts)
  - typedialog-tui: TUI backend (this tool, recommended for interactive use)
  - typedialog-web: Web backend (browser-based)

ENVIRONMENT VARIABLES:
  TYPEDIALOG_LANG   Locale for form localization (e.g., 'en-US', 'es-ES')
  LANG               System locale (fallback if TYPEDIALOG_LANG not set)
  LC_ALL             Alternate locale setting (fallback to LANG)

EXAMPLES:
  # Run TUI form directly
  typedialog-tui config.toml

  # With Spanish locale
  TYPEDIALOG_LANG=es-ES typedialog-tui config.toml

  # Output as JSON
  typedialog-tui config.toml --format json > results.json"#;

/// Long help for typedialog-web
pub const WEB_MAIN_LONG_ABOUT: &str = r#"typedialog-web - Web server for interactive forms.

Provides an HTTP server for filling out forms via web browser. Access forms at:
  http://localhost:PORT/form/CONFIG_NAME

This is the Web-specific binary. To use Web backend with typedialog CLI, set:
  TYPEDIALOG_BACKEND=web typedialog form <config>

Available backends via typedialog main command:
  - typedialog: CLI backend (step-by-step prompts)
  - typedialog-tui: TUI backend (terminal UI)
  - typedialog-web: Web backend (this tool, recommended for teams)

ENVIRONMENT VARIABLES:
  TYPEDIALOG_PORT   Port to listen on (default: 9000, overridden by --port flag)
  TYPEDIALOG_LANG   Locale for form localization (e.g., 'en-US', 'es-ES')
  LANG               System locale (fallback if TYPEDIALOG_LANG not set)
  LC_ALL             Alternate locale setting (fallback to LANG)

EXAMPLES:
  # Run web server on default port 9000
  typedialog-web config.toml

  # Run on custom port via environment variable
  TYPEDIALOG_PORT=8080 typedialog-web config.toml

  # Run on custom port via flag (takes precedence)
  typedialog-web config.toml --port 3000

  # With Spanish locale
  TYPEDIALOG_LANG=es-ES typedialog-web config.toml --port 8080"#;

/// Help text explaining environment variables
pub const ENV_VARS_HELP: &str = r#"
ENVIRONMENT VARIABLES:
  TYPEDIALOG_BACKEND    Backend to use: 'cli', 'tui', or 'web' (default: 'cli')
                         Only used by 'typedialog' command
  TYPEDIALOG_PORT       Port for web backend (default: 9000)
  TYPEDIALOG_LANG       Locale for form localization (e.g., 'en-US', 'es-ES')
  LANG                   System locale (fallback if TYPEDIALOG_LANG not set)
  LC_ALL                 Alternate locale setting (fallback to LANG)

EXAMPLES:
  # Use TUI backend instead of CLI
  TYPEDIALOG_BACKEND=tui typedialog form config.toml

  # Use Web backend on custom port
  TYPEDIALOG_BACKEND=web TYPEDIALOG_PORT=8080 typedialog form config.toml

  # Force Spanish locale
  TYPEDIALOG_LANG=es-ES typedialog form config.toml
"#;

/// Help text explaining backends
pub const BACKENDS_HELP: &str = r#"
BACKENDS:
  CLI         Step-by-step prompts (scriptable, default)
              Run: typedialog form <config>

  TUI         3-panel terminal UI (best for interactive use)
              Run: typedialog-tui <config>
              Or:  TYPEDIALOG_BACKEND=tui typedialog form <config>

  Web         Browser-based interface (best for teams)
              Run: typedialog-web <config> --port 8080
              Or:  TYPEDIALOG_BACKEND=web typedialog form <config>

All backends produce identical JSON output from the same TOML form definition.
"#;

/// Help text for --locale flag
pub const LOCALE_FLAG_HELP: &str =
    "Locale override for form localization (e.g., 'en-US', 'es-ES')\n\
     Priority: CLI flag > form locale > TYPEDIALOG_LANG > LANG > LC_ALL > default (en-US)";

/// Help text for --format flag
pub const FORMAT_FLAG_HELP: &str =
    "Output format: 'json', 'yaml', 'toml', or 'text' (default: text)\n\
     JSON format enables integration with other tools (jq, terraform, etc.)";

/// Help text for --out flag
pub const OUT_FLAG_HELP: &str = "Output file (if not specified, writes to stdout)";
