Skip to content

Commit d96912b

Browse files
Fix tabtab for -- options
Add implementation of IOptionsService interface with one method - getKnownOptions. This method is used in commands service in order to get full list of supported -- options. As each CLI have its own list of knownOptions and the mobile lib has only some of them, the implementation of the interface has to be outside of the lib. This way we can use autocomplete for all available options, not only for the common ones.
1 parent b22ca15 commit d96912b

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

lib/bootstrap.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@ $injector.requireCommand("list-devices", "./commands/list-devices");
3434

3535
$injector.require("npm", "./node-package-manager");
3636
$injector.require("config", "./config");
37+
$injector.require("optionsService", "./services/options-service");

lib/services/options-service.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
///<reference path="../.d.ts"/>
2+
3+
"use strict";
4+
5+
import options = require("../options");
6+
7+
export class OptionsService implements IOptionsService {
8+
public getKnownOptions(): string[]{
9+
return Object.keys(options.knownOpts);
10+
}
11+
}
12+
$injector.register("optionsService", OptionsService);

0 commit comments

Comments
 (0)