I have this code:
program.prompt "folder: ", (folder) ->
program.prompt "file: ", (file) ->
console.log folder + "/" + file
console.log "^ Entered path"
This will print:
^ Entered path
to the prompt.
There is an invisible new line character after folder and file.
Could this be removed?
because input is line-buffered, so both folder and file have a newline, you can .trim() them if you want
But I don't get why you would want a new line as default. That forces everyone to use trim(). Couldn't this be taken care of behind the scenes?
In this way I don't have to have code like this:
program.prompt "name: ", (name) ->
name = name.trim()
program.prompt "description: ", (file) ->
file = file.trim()
program.prompt "homepage: (*none*) ", (homepage = "0.0.1") ->
homepage = homepage.trim()
program.prompt "username: (*github*) ", (username = "0.0.1") ->
username = username.trim()
program.prompt "author: ", (author) ->
author = author.trim()
program.prompt "email: ", (email) ->
email = email.trim()
program.prompt "url: ", (url) ->
true, I suppose we could do that :)
Fixed: line-buffered input automatically trimmed. Closes #31