Skip to content

Commit

Permalink
completion: comment list code
Browse files Browse the repository at this point in the history
  • Loading branch information
chjj committed Mar 29, 2012
1 parent 4c6b899 commit 06598b4
Showing 1 changed file with 11 additions and 22 deletions.
33 changes: 11 additions & 22 deletions lib/jitsu/completion.js
Expand Up @@ -220,17 +220,6 @@ var commands = {
if (prev === 'app') {
return commands.apps.view(words, prev, cur);
}

// POSSIBLY just complete for cwd
var name = cache.read('pkg');
if (name) {
return echo(match(cur, [name]));
}

return jitsu.package.tryRead(process.cwd(), callback, function(pkg) {
echo(match(cur, [pkg.name]));
cache.write('pkg', pkg.name);
});
}
},

Expand All @@ -242,18 +231,18 @@ var commands = {
'create': {},
'list': function(words, prev, cur) {
return commands.apps.view(words, prev, cur);

// POSSIBLY just complete for cwd
var name = cache.read('pkg');
if (name) {
return echo(match(cur, [name]));
}

return jitsu.package.tryRead(process.cwd(), callback, function(pkg) {
echo(match(cur, [pkg.name]));
cache.write('pkg', pkg.name);
});
},
// Possibly just check cwd instead, same for `logs app`
// 'list': function(words, prev, cur) {
// var name = cache.read('pkg');
// if (name) {
// return echo(match(cur, [name]));
// }
// return jitsu.package.tryRead(process.cwd(), callback, function(pkg) {
// echo(match(cur, [pkg.name]));
// cache.write('pkg', pkg.name);
// });
// },
'activate': function(words, prev, cur) {
return commands.apps.view(words, prev, cur);
},
Expand Down

0 comments on commit 06598b4

Please sign in to comment.