diff --git a/shell.js b/shell.js index b205ec1..7702940 100644 --- a/shell.js +++ b/shell.js @@ -64,7 +64,7 @@ exports.pwd = wrap('pwd', _pwd); //@ Available options: //@ //@ + `-R`: recursive -//@ + `-a`: all files (include files beginning with `.`) +//@ + `-A`: all files (include files beginning with `.`) //@ //@ Examples: //@ @@ -78,7 +78,7 @@ exports.pwd = wrap('pwd', _pwd); function _ls(options, paths) { options = parseOptions(options, { 'R': 'recursive', - 'a': 'all' + 'A': 'all' }); if (!paths) @@ -127,7 +127,7 @@ function _ls(options, paths) { var oldDir = _pwd(); _cd('', p); if (fs.statSync(file).isDirectory()) - list = list.concat(_ls('-R'+(options.all?'a':''), file+'/*')); + list = list.concat(_ls('-R'+(options.all?'A':''), file+'/*')); _cd('', oldDir); } }); @@ -155,7 +155,7 @@ function _ls(options, paths) { if (options.recursive) { var pp = dirname + '/' + file; if (fs.statSync(pp).isDirectory()) - list = list.concat(_ls('-R'+(options.all?'a':''), pp+'/*')); + list = list.concat(_ls('-R'+(options.all?'A':''), pp+'/*')); } // recursive } // if file matches }); // forEach @@ -208,7 +208,7 @@ function _find(options, paths) { pushFile(file); if (fs.statSync(file).isDirectory()) { - _ls('-Ra', file+'/*').forEach(function(subfile) { + _ls('-RA', file+'/*').forEach(function(subfile) { pushFile(subfile); }); } diff --git a/test/ls.js b/test/ls.js index 8aca71b..0f653fb 100644 --- a/test/ls.js +++ b/test/ls.js @@ -61,7 +61,7 @@ assert.equal(result.length, 6); // no args, 'all' option shell.cd('resources/ls'); -var result = shell.ls('-a'); +var result = shell.ls('-A'); assert.equal(shell.error(), null); assert.equal(result.indexOf('file1') > -1, true); assert.equal(result.indexOf('file2') > -1, true); @@ -168,7 +168,7 @@ assert.equal(result.indexOf('a_dir/b_dir/z') > -1, true); assert.equal(result.length, 9); // recusive, path given - 'all' flag -var result = shell.ls('-Ra', 'resources/ls'); +var result = shell.ls('-RA', 'resources/ls'); assert.equal(shell.error(), null); assert.equal(result.indexOf('a_dir') > -1, true); assert.equal(result.indexOf('a_dir/b_dir') > -1, true);