Permalink
Browse files

support simple paths

  • Loading branch information...
1 parent bc8c102 commit 16bd6ca8ecd76f4c3d4bfb91fc57562098eae4ba @nichtich nichtich committed May 1, 2015
Showing with 12 additions and 14 deletions.
  1. +12 −14 index.js
View
@@ -107,29 +107,27 @@ Gr.prototype.parseTargets = function(argv) {
isTarget = true;
argv.shift();
break;
- case '~':
- case '/':
- case '.':
- // paths
- targetPath = path.resolve(process.cwd(), argv[0]);
- if (fs.existsSync(targetPath) && fs.statSync(targetPath).isDirectory()) {
- this.directories.push(targetPath);
- processed++;
- isTarget = true;
- argv.shift();
- }
- break;
default:
if (argv[0] == '--json') {
argv.shift();
this.format = 'json';
isTarget = true;
processed++;
- } else if (argv[0] == '--') {
+ break;
+ }
+ if (argv[0] == '--') {
isTarget = false;
processed++;
+ break;
+ }
+ // paths
+ targetPath = path.resolve(process.cwd(), argv[0]);
+ if (fs.existsSync(targetPath) && fs.statSync(targetPath).isDirectory()) {
+ this.directories.push(targetPath);
+ processed++;
+ isTarget = true;
+ argv.shift();
}
- break;
}
} while (isTarget && argv.length > 0);

0 comments on commit 16bd6ca

Please sign in to comment.