flosse / sloc

simple tool to count SLOC (source lines of code)
MIT License
943 stars 84 forks source link

Restore back cli options #144

Closed domengasperlin closed 6 months ago

domengasperlin commented 6 months ago

It seems release is failing due to failing test here https://github.com/Homebrew/homebrew-core/pull/158728

The test is checking if sloc works with csv format option https://github.com/Homebrew/homebrew-core/blob/171e50bca163025fd40fde21629cc667da49c77c/Formula/s/sloc.rb#L23

Options functionality was broken with commander v7.0.0 release.

From migration guide for commander lib

Use the .opts() method to access the options. This is available on any command but is used most with the program. Details: https://github.com/tj/commander.js/releases/tag/v7.0.0

Result

This change restores back command options version, exclude, include, format, format-option, strip-colors. So all the options work again.

Options:
  -V, --version                            output the version number
  -e, --exclude <regex>                    regular expression to exclude files and folders
  -i, --include <regex>                    regular expression to include files and folders
  -f, --format <format>                    format output: csv, cli-table, simple, json
  --format-option [value]                  add formatter option (default: [])
  --strip-colors                           remove all color characters
  -k, --keys <keys>                        report only numbers of the given keys
  -d, --details                            report stats of each analyzed file
  -a, --alias <custom ext>=<standard ext>  alias custom ext to act like standard ext
  -h, --help                               display help for command
flosse commented 6 months ago

Thx!

flosse commented 6 months ago

Let me know if I should create a release :)

domengasperlin commented 6 months ago

Let me know if I should create a release :)

Please yes, test output now also matches the one from brew

image image
chenrui333 commented 6 months ago

Can we cut a pre-release or release for testing? There is no clean way to apply this PR change.

rhysperry111 commented 4 months ago

Just bumping this - a release would be really helpful because the tool is currently completely broken.

flosse commented 4 months ago

Just bumping this - a release would be really helpful because the tool is currently completely broken.

sure :+1: Should be online now.