Skip to content
This repository was archived by the owner on Feb 2, 2021. It is now read-only.

Commit a514d6b

Browse files
committed
Autocompletion
1 parent e2df9df commit a514d6b

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

definitions/config.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ declare module Config {
22
interface IStaticConfig {
33
PROJECT_FILE_NAME: string;
44
CLIENT_NAME: string;
5+
CLIENT_NAME_ALIAS?: string;
56
ANALYTICS_API_KEY: string;
67
version: string;
78
helpTextPath: string;

services/commands-service.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ export class CommandsService implements ICommandsService {
7070

7171
public completeCommand(getPropSchemaAction?: any): IFuture<any> {
7272
return (() => {
73-
var tabtab = require("tabtab");
74-
tabtab.complete(this.$staticConfig.CLIENT_NAME, (err: Error, data: any) => {
73+
var completeCallback = (err: Error, data: any) => {
7574
if (err || !data) {
7675
return;
7776
}
@@ -121,7 +120,15 @@ export class CommandsService implements ICommandsService {
121120
}
122121

123122
return false;
124-
});
123+
};
124+
125+
126+
var tabtab = require("tabtab");
127+
tabtab.complete(this.$staticConfig.CLIENT_NAME, completeCallback);
128+
129+
if(this.$staticConfig.CLIENT_NAME_ALIAS) {
130+
tabtab.complete(this.$staticConfig.CLIENT_NAME_ALIAS, completeCallback);
131+
}
125132

126133
return true;
127134
}).future<any>()();

0 commit comments

Comments
 (0)