Skip to content

Conversation

@nfischer
Copy link
Member

This fixes a couple issues with config.verbose logging, and some related things.

  • set('-v') previously didn't log echo() commands because those weren't common.wrap'ed
  • echo() is now wrapped, but is designed to still allow echoing strings that start with "-" (ex. "-1*3+5") (see issue Cannot echo a string that starts with - #20)
  • echo() still does not glob. This is because 1. globbing isn't that useful for echo() in my opinion, and 2. echo is frequently used enough that it should have good performance by default
  • internal errors are now outputted to stderr instead of stdout
  • set('-v')-style logging goes to stderr, not stdout. This resembles Bash's behavior with set -v

The way this is implemented, echo() still doesn't support any options, but we may want to consider allowing for that in the future (-n comes to mind). It'd be pretty easy to add support for that option once this is merged.

Also, it simplifies things if echo() is wrapped, since it ensures that commands like echo(pwd()) still work the same, even if #360 lands.

@nfischer nfischer added fix Bug/defect, or a fix for such a problem medium priority labels Feb 17, 2016
@nfischer nfischer added this to the v0.7.0 milestone Feb 17, 2016
@ariporad
Copy link
Contributor

Can we add a test that verbose mode works with echo?

Otherwise than that, LGTM!

@nfischer
Copy link
Member Author

@ariporad I fixed one of the tests to check that echo is logged (it previously allowed it not to be logged, since it wasn't wrapped)

assert.equal(result.stdout, 'ls file_doesnt_exist\n1234\n');
assert.equal(result.stderr, 'ls: no such file or directory: file_doesnt_exist\n');
assert.equal(result.stdout, '1234\n');
assert.equal(result.stderr, 'ls file_doesnt_exist\nls: no such file or directory: file_doesnt_exist\necho 1234\n');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ariporad here's an example where it tests echo() being logged

@nfischer nfischer mentioned this pull request Feb 19, 2016
@ariporad
Copy link
Contributor

LGTM!

ariporad added a commit that referenced this pull request Feb 19, 2016
fix(verbose): verbose-style logging is consistent
@ariporad ariporad merged commit e3a34a7 into master Feb 19, 2016
@ariporad ariporad deleted the fix-verbose-logging branch February 19, 2016 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug/defect, or a fix for such a problem medium priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants