Add qeda completion command to CLI

This commit is contained in:
Shamil Yakupov
2016-09-22 14:30:31 +03:00
parent 06fc34a402
commit 6bfe0e2cb4
2 changed files with 17 additions and 0 deletions

View File

@@ -31,6 +31,7 @@ Commands:\n\
config PARAM [VALUE] Set/get config parameter\n\ config PARAM [VALUE] Set/get config parameter\n\
generate LIBRARY Generate libraries according to config\n\ generate LIBRARY Generate libraries according to config\n\
test COMPONENT Generate test library with one component only\n\ test COMPONENT Generate test library with one component only\n\
completion Display completion script\n\
\n\ \n\
Examples: \n\ Examples: \n\
qeda reset\n\ qeda reset\n\
@@ -307,6 +308,9 @@ switch (command) {
} }
testComponent(args.argv.remain[1]); testComponent(args.argv.remain[1]);
break; break;
case 'completion':
console.log(fs.readFileSync(__dirname + '/../scripts/qeda').toString());
break;
default: default:
displayError('Unknown command "' + command + '"'); displayError('Unknown command "' + command + '"');

View File

@@ -1,3 +1,16 @@
#
# qeda command completion script
#
# Installation:
# source <(qeda completion)
# ... or:
# qeda completion >> ~/.bashrc (or ~/.zshrc)
# ... or:
# qeda completion > /usr/local/etc/bash_completion.d/qeda
# ... or:
# qeda completion > /etc/bash_completion.d/qeda
#
_qeda() _qeda()
{ {
local cur prev opts base local cur prev opts base