forked from enviPath/enviPy
Current Dev State
This commit is contained in:
34
static/js/ketcher2/node_modules/shelljs/src/echo.js
generated
vendored
Normal file
34
static/js/ketcher2/node_modules/shelljs/src/echo.js
generated
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
var common = require('./common');
|
||||
|
||||
common.register('echo', _echo, {
|
||||
allowGlobbing: false,
|
||||
});
|
||||
|
||||
//@
|
||||
//@ ### echo([options,] string [, string ...])
|
||||
//@ Available options:
|
||||
//@
|
||||
//@ + `-e`: interpret backslash escapes (default)
|
||||
//@
|
||||
//@ Examples:
|
||||
//@
|
||||
//@ ```javascript
|
||||
//@ echo('hello world');
|
||||
//@ var str = echo('hello world');
|
||||
//@ ```
|
||||
//@
|
||||
//@ Prints string to stdout, and returns string with additional utility methods
|
||||
//@ like `.to()`.
|
||||
function _echo(opts, messages) {
|
||||
// allow strings starting with '-', see issue #20
|
||||
messages = [].slice.call(arguments, opts ? 0 : 1);
|
||||
|
||||
if (messages[0] === '-e') {
|
||||
// ignore -e
|
||||
messages.shift();
|
||||
}
|
||||
|
||||
console.log.apply(console, messages);
|
||||
return messages.join(' ');
|
||||
}
|
||||
module.exports = _echo;
|
||||
Reference in New Issue
Block a user