mirror of
https://github.com/shelljs/shelljs.git
synced 2026-01-18 16:03:37 +00:00
refactor: hook new uniq() command using new format (#478)
This commit is contained in:
parent
3367e0c6c7
commit
bd6f96db33
3
shell.js
3
shell.js
@ -80,8 +80,7 @@ require('./src/sed');
|
||||
require('./src/sort');
|
||||
|
||||
//@include ./src/uniq
|
||||
var _uniq = require('./src/uniq');
|
||||
exports.uniq = common.wrap('uniq', _uniq, {idx: 1, canReceivePipe: true});
|
||||
require('./src/uniq');
|
||||
|
||||
//@include ./src/grep
|
||||
require('./src/grep');
|
||||
|
||||
@ -10,6 +10,8 @@ function lpad(c, str){
|
||||
return res;
|
||||
}
|
||||
|
||||
common.register('uniq', _uniq, {globStart: 1, canReceivePipe: true});
|
||||
|
||||
//@
|
||||
//@ ### uniq([options,] [input, [output]])
|
||||
//@ Available options:
|
||||
|
||||
@ -39,6 +39,12 @@ assert.equal(shell.error(), null);
|
||||
assert.equal(result.code, 0);
|
||||
assert.equal(result + '', shell.cat('resources/uniq/file2u').toString());
|
||||
|
||||
// with glob character
|
||||
result = shell.uniq('-i', 'resources/uniq/fi?e2');
|
||||
assert.equal(shell.error(), null);
|
||||
assert.equal(result.code, 0);
|
||||
assert.equal(result + '', shell.cat('resources/uniq/file2u').toString());
|
||||
|
||||
//uniq file1 file2
|
||||
shell.uniq('resources/uniq/file1', 'resources/uniq/file1t');
|
||||
assert.equal(shell.error(), null);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user