Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

freitagbr
Copy link
Contributor

Fixes #476

@nfischer
Copy link
Member

@freitagbr Can you also add a test?

@freitagbr
Copy link
Contributor Author

@nfischer Sure. I am thinking however that the behavior of this should be changed. Currently, console.log is used, and a newline is automatically placed at the end of the output. Instead, I think process.stdout.write should be used, as it only writes to stdout what is literally passed in.

@nfischer
Copy link
Member

@freitagbr unix echo adds a newline by default. Probably best to keep using console.log() for this scenario.

You raise a good point though, so I filed #557

@nfischer
Copy link
Member

Looks good. Let's wait until we ava-ify the tests for echo though, to avoid callback hell.

@freitagbr
Copy link
Contributor Author

Ok. Is it worth adding support for -n in the meantime? Or should I wait until this is merged?

@nfischer
Copy link
Member

You can do that in a new PR, it shouldn't necessarily be blocked by this. Either way, let's wait to get the echo tests ava-ified.

@freitagbr
Copy link
Contributor Author

@nfischer I rewrote the test for this branch.

@nfischer nfischer changed the base branch from master to dev November 27, 2016 19:51
@nfischer
Copy link
Member

LGTM, make sure we land this on dev, not master.

@freitagbr freitagbr merged commit 23ef7eb into shelljs:dev Nov 27, 2016
@freitagbr freitagbr deleted the echo-newline branch November 27, 2016 21:12
freitagbr added a commit that referenced this pull request Dec 7, 2016
* Add newline to output of echo

* Add test
nfischer pushed a commit that referenced this pull request Dec 8, 2016
* Add newline to output of echo

* Add test
nfischer pushed a commit that referenced this pull request Jan 17, 2017
* Add newline to output of echo

* Add test
freitagbr pushed a commit that referenced this pull request Mar 16, 2017
* Add newline to output of echo (#557)

* Add newline to output of echo

* Add test

* Throw an error if the options string does not start with '-' (#615)

* Throw an error if the options string does not start with '-'

* Add test

* Change message grammar

* Add -n option to echo

* Fix null argument issue

* Add -n tests

* Add documentation

* Add -en escaped character test

* Add function to parse options for echo

* Use parseOptions to parse echo options

* Simplify control flow

* parseOptions throws now

* Allow null to be echoed

* Prevent echo stderr on unrecognized option

* Add test to check stderr of returned value

* Use consistent variable name

* Change test message, leave TODO about console output
freitagbr added a commit that referenced this pull request Jun 7, 2017
* Add newline to output of echo

* Add test
freitagbr pushed a commit that referenced this pull request Jun 7, 2017
* Add newline to output of echo (#557)

* Add newline to output of echo

* Add test

* Throw an error if the options string does not start with '-' (#615)

* Throw an error if the options string does not start with '-'

* Add test

* Change message grammar

* Add -n option to echo

* Fix null argument issue

* Add -n tests

* Add documentation

* Add -en escaped character test

* Add function to parse options for echo

* Use parseOptions to parse echo options

* Simplify control flow

* parseOptions throws now

* Allow null to be echoed

* Prevent echo stderr on unrecognized option

* Add test to check stderr of returned value

* Use consistent variable name

* Change test message, leave TODO about console output
@nfischer nfischer mentioned this pull request Jun 7, 2017
nfischer pushed a commit that referenced this pull request Jun 7, 2017
* Add newline to output of echo

* Add test
nfischer added a commit that referenced this pull request Jun 7, 2017
* Add newline to output of echo (#557)

* Add newline to output of echo

* Add test

* Throw an error if the options string does not start with '-' (#615)

* Throw an error if the options string does not start with '-'

* Add test

* Change message grammar

* Add -n option to echo

* Fix null argument issue

* Add -n tests

* Add documentation

* Add -en escaped character test

* Add function to parse options for echo

* Use parseOptions to parse echo options

* Simplify control flow

* parseOptions throws now

* Allow null to be echoed

* Prevent echo stderr on unrecognized option

* Add test to check stderr of returned value

* Use consistent variable name

* Change test message, leave TODO about console output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants