thlorenz / replpad

Pipes content of files to a node repl whenever they change to enable a highly interactive coding experience.
http://thlorenz.github.com/replpad/
MIT License
213 stars 19 forks source link

replpad --help or replpad -h doesn't work #12

Closed Raynos closed 10 years ago

Raynos commented 10 years ago

I wanted to find out how to use replpad and ran

replpad -h and replpad --help

I expected a help text output.

Instead I got

/home/raynos/projects/nvm/v0.10.26/lib/node_modules/replpad/lib/log.js:19
      this.output.write(colors.red('ERR! '), format.apply(this, arguments) + '
                  ^
TypeError: Cannot call method 'write' of undefined
    at Stream.module.exports.error (/home/raynos/projects/nvm/v0.10.26/lib/node_modules/replpad/lib/log.js:19:19)
    at Stream.EventEmitter.emit (events.js:95:17)
    at handleFatalError (/home/raynos/projects/nvm/v0.10.26/lib/node_modules/replpad/node_modules/readdirp/stream-api.js:63:72)
    at /home/raynos/projects/nvm/v0.10.26/lib/node_modules/replpad/node_modules/readdirp/readdirp.js:258:7
    at gotStat (fs.js:1383:21)
    at Object.oncomplete (fs.js:107:15)

I took a look around but couldn't figure out why output is undefined since it seems to be set in the entry point

thlorenz commented 10 years ago

Yeah do this instead:

➝  replpad

Loading replpad config from: /Users/thlorenz/.config/replpad/config.js

Watching no files since no path was specified.

replpad v0.11.8

node v0.10.28 | thlorenz-mbp | 4 cpus | darwin platform | v8 v3.14.5.9 | uv v0.10.27

plugins: vim | matchtoken

If in doubt, enter .help

pad > .help
.append         Appends the last entered parsable chunk of code or the last line to the last file that was sourced in the repl

.clear          Break, and also clear the local context

.compact        [on] Toggles if code is compacted before being sourced to the repl

.depth          [2] Sets the depth to which an object is traversed when printed to the repl

.exit           Exit the repl

.help           Show this list of repl commands

.hidden         [off] Set whether hidden properties are included during traversal of an object that is printed to the repl

.highlight      [off] Toggles if syntax highlighted code is printed to the repl before being sourced

.load           Load JS from a file into the REPL session

.save           Save all evaluated commands in this REPL session to a file

.talk           [off] Toggles whether the file content is evaluated with scriptie-talkie when it is piped to the repl
thlorenz commented 10 years ago

Open to a PR that makes this work though. ATM args parsing is rather simple

thlorenz commented 10 years ago

Can't help myself though from pointing out this line that is printed in your face when you launch replpad:

If in doubt, enter .help
Raynos commented 10 years ago

@thlorenz agreed. I figured out how to get the help.

I was just suprised to see an exception instead of a "argument -h / --help is not supported"

thlorenz commented 10 years ago

Yeah it's cause it assumes -h is a path or something like that. Closing this, but feel free to PR to improve on it.