-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(lock): adds auto-completion for options
- Loading branch information
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | ||
} | ||
]; | ||
} | ||
}; |