ddopson / underscore-cli

Command-line utility-belt for hacking JSON and Javascript.
Other
1.72k stars 83 forks source link

Installation quirk #11

Closed murphyke closed 12 years ago

murphyke commented 12 years ago

I just installed Node and underscore-cli on Mac OS X Lion and wanted to report that, while the sample commands work, when I run 'underscore help', the command name and subcommand names are all replaced by the word 'undefined' in the subsequent output, i.e.:

$ underscore help

Usage: 
undefined <command> [--in <filename>|--data <JSON>|--nodata] [--infmt <format>] [--out <filename>] [--outfmt <format>] [--quiet] [--strict] [--color] [--text] [--trace] [--coffee] [--js]

Commands:

undefined [command]  Print more detailed help and examples for a specific command
undefined            Print the type of the input data: {object, array, number, string, boolean, null, undefined}
undefined            Output the data without any transformations. Can be used to pretty-print JSON data.
...
ddopson commented 12 years ago

weird. Not sure how to reproduce this...

willwhitney commented 12 years ago

I'm having the same thing. Node 0.8.7, OSX 10.8.2, underscore-cli 0.2.13. Anything I can do to help debug?

ddopson commented 12 years ago

I'm on Node 0.8.1, OSX 10.7.5, and I've tried both 0.2.13 from NPM and the latest code in github and I don't see this issue.

Can you try it with the code from github? Once you check it out / npm-install, you should be able to run bin/underscore.

I have a suspicion where this could come from. Back in 31c7d26, I switched to not initializing all of the commands unless we were printing help. Hmm, except that can't be it because the commands are printing, just minus the names.

Hmm. What is the version of commander.js that is installed? (you can see it by doing "npm ls") Maybe a change there broke us.

willwhitney commented 12 years ago

It's commander.js 1.0.5. Same thing happens when I run the git clone'd version.

ddopson commented 12 years ago

Mine is 0.6.1. Bet that's the issue.

ddopson commented 12 years ago

REPRO! ok, now I can fix this.

willwhitney commented 12 years ago

Awesome! Glad I could help.