Skip to content

Add support for essential global CLI options #35

@jai-deepsource

Description

@jai-deepsource

Add essential global CLI options to improve user experience, configuration flexibility, and output formatting capabilities.

Proposed Options

--config, -c       Path to config file (default: .globstar/.config.yml)
--verbose, -v      Enable verbose output
--no-color         Disable colored output
--format, -f       Output format (json, yaml, text) (default: text)
--version          Print version information

Implementation Details

Configuration File Path

  • Add flag parsing for --config/-c
  • Implement config file loading logic with YAML parsing
  • Add fallback to default path if not specified
  • Handle invalid config file gracefully with meaningful error messages

Verbose Output

  • Implement verbose logging system
  • Add debug information about:
    • Checker loading and initialization
    • Configuration details
    • File processing information

Color Control

  • Implement color detection for terminals
  • Add color disable flag
  • Ensure CI/CD compatibility
  • Consider auto-detection of NO_COLOR environment variable

Output Formatting

  • Implement formatters for each output type:
    • JSON: Structured output for programmatic consumption
    • YAML: Human-readable structured output
    • Text: Default human-readable format
  • Ensure consistent schema across formats
  • Add output validation

Version Information

  • Add version flag handler
  • Display:
    • Globstar version
    • Git commit hash
    • Go version used for build

Acceptance Criteria

  • All flags work as specified when used individually
  • Flags work correctly in combination
  • Meaningful error messages for invalid usage
  • Documentation updated to reflect new options
  • Tests added for new functionality
  • CI pipeline updated to test new options

Notes

Leverage urfave/cli's built-in features:

  • Command categorization
  • Shell completion
  • Default help texts

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions