Skip to content

Commit 0b5b9f5

Browse files
rosen-vladimirovMihail Slavchev
authored andcommitted
Fix usage of shorthand options
Fix usage of shorthands, so when you specify -v to use verbose mode. Update common lib where shorthands for help command had been added. https://huboard.com/NativeScript/nativescript-cli#/issues/54758692
1 parent 54a1586 commit 0b5b9f5

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

lib/options.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var knownOpts:any = {
2020
"keyStoreAlias": String,
2121
"keyStoreAliasPassword": String
2222
},
23-
shorthands = {
23+
shorthands: IStringDictionary = {
2424
};
2525

2626
_.extend(knownOpts, commonOptions.knownOpts);
@@ -37,7 +37,14 @@ if(hostInfo.isWindows()) {
3737
commonOptions.setProfileDir(defaultProfileDir);
3838
var parsed = helpers.getParsedOptions(knownOpts, shorthands, "nativescript");
3939

40-
Object.keys(parsed).forEach((opt) => exports[opt] = parsed[opt]);
40+
Object.keys(parsed).forEach(opt => {
41+
var key = opt;
42+
if(shorthands[opt]) {
43+
key = shorthands[opt];
44+
}
45+
46+
exports[key] = parsed[opt];
47+
});
4148
exports.knownOpts = knownOpts;
4249

4350
declare var exports:any;

0 commit comments

Comments
 (0)