flosse / flosse/sloc

Can't use --details and --format together

Open
#57 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
CoffeeScript
Stars
972
Forks
80
PR merge metrics
No merged PRs in 30d

Description

Please see example command lines and errors below:

``` bash
Yarons-MacBook-Pro:Thali_CordovaPlugin yarongoland$ sloc --format cli-table --details test/

/usr/local/lib/node_modules/sloc/node_modules/cli-table/lib/index.js:182
var contents = item.toString().split("\n").reduce(function (memo, l) {
^
TypeError: Cannot call method 'toString' of undefined
at /usr/local/lib/node_modules/sloc/node_modules/cli-table/lib/index.js:182:27
at Array.forEach (native)
at generateRow (/usr/local/lib/node_modules/sloc/node_modules/cli-table/lib/index.js:181:11)
at /usr/local/lib/node_modules/sloc/node_modules/cli-table/lib/index.js:275:16
at Table.forEach (native)
at Table.toString (/usr/local/lib/node_modules/sloc/node_modules/cli-table/lib/index.js:258:10)
at module.exports (/usr/local/lib/node_modules/sloc/lib/formatters/cli-table.js:47:18)
at print (/usr/local/lib/node_modules/sloc/lib/cli.js:98:11)
at finish (/usr/local/lib/node_modules/sloc/lib/cli.js:170:14)
at done (/usr/local/lib/node_modules/sloc/node_modules/async/lib/async.js:132:19)
Yarons-MacBook-Pro:Thali_CordovaPlugin yarongoland$ sloc --details --format cli-table test/

/usr/local/lib/node_modules/sloc/node_modules/cli-table/lib/index.js:182
var contents = item.toString().split("\n").reduce(function (memo, l) {
^
TypeError: Cannot call method 'toString' of undefined
at /usr/local/lib/node_modules/sloc/node_modules/cli-table/lib/index.js:182:27
at Array.forEach (native)
at generateRow (/usr/local/lib/node_modules/sloc/node_modules/cli-table/lib/index.js:181:11)
at /usr/local/lib/node_modules/sloc/node_modules/cli-table/lib/index.js:275:16
at Table.forEach (native)
at Table.toString (/usr/local/lib/node_modules/sloc/node_modules/cli-table/lib/index.js:258:10)
at module.exports (/usr/local/lib/node_modules/sloc/lib/formatters/cli-table.js:47:18)
at print (/usr/local/lib/node_modules/sloc/lib/cli.js:98:11)
at finish (/usr/local/lib/node_modules/sloc/lib/cli.js:170:14)
at done (/usr/local/lib/node_modules/sloc/node_modules/async/lib/async.js:132:19)
Yarons-MacBook-Pro:Thali_CordovaPlugin yarongoland$
```

I run the same command twice, I just changed the order of the arguments.

Note, btw, that both `sloc --details test/` and `sloc --format cli-table test/` work just fine. It's only when I put the two options together that I get the error.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.