Closed deanrad closed 9 years ago
Looks good. I'm a but unsure about the above if-condition, once resolved. I'll merge, and make a new release.
Because in json format you pass the file containing the deps data, you don't need spider files, making the CLI arg required only for the previous use cases.
We agree that to pass the file you need to pass the file via --deps
as dependo -f json --deeps <file>
, right?
The above condition is to display a nice help message if no arguments are passed like dependo
. What case does the current condition cover? If I pass -f json
, Commander.args
anyway has a length?
If I pass -f json, Commander.args anyway has a length?
Not correct. Commander.args doesn't include switches/options/whatever they're called :)
But see the latest diff - I think it will satisfy us both, and be simpler.
> dependo # prints help
> dependo -f cjs # prints help
> dependo -f json # prints help
> dependo -f json file.json # does good
> dependo -f cjs dir/ # does good
Totally makes sense to use pass the file as the "input" in first argument. :+1:
Cool- were on a roll !
With example.json containing:
{"a":["sub/b"],"d":[],"fancy-main/not-index":[],"sub/b":["sub/c"],"sub/c":["d"]}
New feature:
./bin/dependo -f json -d example.json > example/index.html ; open example/index.html
Regression tested with:./bin/dependo -f cjs lib/ > example/index.html ; open example/index.html