Skip to content

Commit

Permalink
better autocomplete
Browse files Browse the repository at this point in the history
  • Loading branch information
machellerogden committed Feb 13, 2017
1 parent 49c40f6 commit 3132dc7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ module.exports = cli;
function cli(options) {
let searchTerm;

if (options.version || options.v) {
console.log(require('./package.json').version);
process.exit(0);
}

if (options.setup) {
return require('./setup')();
}
Expand All @@ -35,7 +40,8 @@ function cli(options) {
const sourceDataPromise = lib.getSourceData();
const pathsPromise = sourceDataPromise.then(lib.getPaths).filter(searchFilter);
if (options.completions) {
return pathsPromise.map(_.ary(console.log, 1));
return pathsPromise.map((repoPath) => _.tail(repoPath.split(path.sep)).join(path.sep))
.each(_.ary(console.log, 1));
} else {
return pathsPromise.then((results) => {
let resultPromise;
Expand Down

0 comments on commit 3132dc7

Please sign in to comment.