Skip to content

Commit

Permalink
feat(lock): adds auto-completion for options
Browse files Browse the repository at this point in the history
  • Loading branch information
Ephigenia committed Apr 19, 2019
1 parent 9d6469e commit c410ab2
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions source/lib/auto-complete/completions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ module.exports = {
new: require('./new'),
projects: require('./projects'),
services: require('./services'),
unlock: require('./unlock'),
users: require('./users'),
};
32 changes: 32 additions & 0 deletions source/lib/auto-complete/completions/unlock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env node
'use strict';

/**
* https://www.npmjs.com/package/tabtab#3-parsing-env
*
* @param {string} env.lastPartial - the characters entered in the current
* argument before hitting tabtab
* @param {string} env.prev - last given argument value, or previously
* completed value
* @param {string} env.words - the number of argument currently active
* @param {string} env.line - the current complete input line in the cli
* @returns {Promise<Array<string>>}
*/
module.exports = async ({ words }) => {
if (words < 3) {
return [
{
mame: 'timeEntryId',
description: 'id of the time entry which should be unlocked',
},
{
name: '--help',
description: 'show help message'
},
{
name: '--force',
description: 'try to force-unlock the time entry'
}
];
}
};

0 comments on commit c410ab2

Please sign in to comment.