Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for essential global CLI options #35

Open
8 tasks
jai-deepsource opened this issue Feb 17, 2025 · 4 comments
Open
8 tasks

Add support for essential global CLI options #35

jai-deepsource opened this issue Feb 17, 2025 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Milestone

Comments

@jai-deepsource
Copy link
Contributor

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
@jai-deepsource jai-deepsource added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Feb 17, 2025
@jai-deepsource
Copy link
Contributor Author

Related: #21

@pkalyankumar1010
Copy link

Hi Devs ,
I am new to this repo
I was trying clone the repo and run it with go run cmd/globstar/main.go
I am getting below erros , i am using ubuntu 22 and go 1.23.2

Image

Is there a manual for setting up this project and running and testing this project for beginners ?

@jai-deepsource
Copy link
Contributor Author

@pkalyankumar1010 Run make build to build the project and ./cmd/globstar to execute the binary.

Ref: https://github.com/DeepSourceCorp/globstar/blob/master/Makefile#L61

@tusharxoxoxo
Copy link
Contributor

having a contribution.md file with clear instructions would be a nice thing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants