Skip to content
This repository was archived by the owner on Apr 30, 2019. It is now read-only.

Commit cfbb48d

Browse files
committed
Merge pull request #228 from KenGorab/command-flags-dont-depend-on-position
Command flags no longer depend on position
2 parents 394bf4a + 775dbae commit cfbb48d

File tree

10 files changed

+3233
-2
lines changed

10 files changed

+3233
-2
lines changed

src/expose/Expose.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,10 @@ class Expose {
119119
opts.default[option.name] = option.default;
120120
}
121121
// we parse our own types
122-
if (option.type !== 'number') {
122+
if (option.type === 'flag') {
123+
opts.boolean.push(option.name);
124+
}
125+
else if (option.type !== 'number') {
123126
opts.string.push(option.name);
124127
}
125128
});
@@ -217,7 +220,7 @@ class Expose {
217220
// command options (option that takes priority, like --version etc)
218221
for (i = 0, ii = options.length; i < ii; i++) {
219222
opt = options[i];
220-
if (opt.command && ctx.hasOpt(opt.name, true)) {
223+
if (opt.command && ctx.hasOpt(opt.name, true) && ctx.getOpt(opt.name)) {
221224
return this.executeCommand(opt.command, ctx);
222225
}
223226
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
install jquery -c f7cfda
2+
install --save jquery -c f7cfda
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
- jquery / jquery : f7cfda : 2015-04-20 17:59
3+
4+
f7cfda | 2015-04-20 17:59 | Robert Dennis @ rdennis
5+
| Add optional jQueryAlias to $(callback) and $().ready(callback).
6+
7+
>> running install..
8+
9+
>> written 1 file:
10+
11+
- jquery/jquery.d.ts
12+
13+
14+
- jquery / jquery : f7cfda : 2015-04-20 17:59
15+
16+
f7cfda | 2015-04-20 17:59 | Robert Dennis @ rdennis
17+
| Add optional jQueryAlias to $(callback) and $().ready(callback).
18+
19+
>> running install..
20+
21+
>> written 1 file:
22+
23+
- jquery/jquery.d.ts
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"version": "v4",
3+
"repo": "borisyankov/DefinitelyTyped",
4+
"ref": "master",
5+
"path": "typings",
6+
"bundle": "typings/tsd.d.ts",
7+
"installed": {
8+
"jquery/jquery.d.ts": {
9+
"commit": "f7cfda9f1a6d4de9953f23db03fd5095ac216d41"
10+
}
11+
}
12+
}

test/nspec/cases/install-save-jquery/expected/typings/jquery/jquery.d.ts

Lines changed: 3162 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference path="jquery/jquery.d.ts" />
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
query d3 --info
2+
query --info d3
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
- d3 / d3
3+
>> d3JS : d3js.org
4+
@ Alex Ford : github.com/gustavderdrache
5+
@ Boris Yankov : github.com/borisyankov
6+
< d3 (external module)
7+
8+
9+
- d3 / d3
10+
>> d3JS : d3js.org
11+
@ Alex Ford : github.com/gustavderdrache
12+
@ Boris Yankov : github.com/borisyankov
13+
< d3 (external module)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
query jquery --history -c f7cfda
2+
query --history jquery -c f7cfda
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
- jquery / jquery : f7cfda : 2015-04-20 17:59
3+
4+
f7cfda | 2015-04-20 17:59 | Robert Dennis @ rdennis
5+
| Add optional jQueryAlias to $(callback) and $().ready(callback).
6+
7+
8+
- jquery / jquery : f7cfda : 2015-04-20 17:59
9+
10+
f7cfda | 2015-04-20 17:59 | Robert Dennis @ rdennis
11+
| Add optional jQueryAlias to $(callback) and $().ready(callback).

0 commit comments

Comments
 (0)