Skip to content

Commit 3ed76a9

Browse files
willemnealdcodeIO
authored andcommitted
CLI: Move OptionDescription to utils/options so types agree (#612)
1 parent 5269a6b commit 3ed76a9

File tree

3 files changed

+17
-20
lines changed

3 files changed

+17
-20
lines changed

Diff for: NOTICE

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ under the licensing terms detailed in LICENSE:
1313
* Joshua Tenner <[email protected]>
1414
* Nidin Vinayakan <[email protected]>
1515
* Aaron Turner <[email protected]>
16+
* Willem Wyndham <[email protected]>
1617

1718
Portions of this software are derived from third-party works licensed under
1819
the following terms:

Diff for: cli/asc.d.ts

+3-10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import { OptionDescription } from "./util/options";
2+
export { OptionDescription };
3+
14
/** Whether this is a webpack bundle or not. */
25
export const isBundle: boolean;
36

@@ -7,16 +10,6 @@ export const isDev: boolean;
710
/** AssemblyScript version. */
811
export const version: string;
912

10-
/** Command line option description. */
11-
export interface OptionDescription {
12-
/** Textual description. */
13-
description: string | string[];
14-
/** Option type, e.g. `string`. */
15-
type: string;
16-
/** Option aliases, if any. */
17-
aliases?: string[];
18-
}
19-
2013
/** Available CLI options. */
2114
export const options: { [key: string]: OptionDescription };
2215

Diff for: cli/util/options.d.ts

+13-10
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1+
/** Command line option description. */
2+
export interface OptionDescription {
3+
/** Textual description. */
4+
description?: string | string[],
5+
/** Data type. One of (b)oolean [default], (i)nteger, (f)loat or (s)tring. Uppercase means multiple values. */
6+
type?: "b" | "i" | "f" | "s" | "I" | "F" | "S",
7+
/** Substituted options, if any. */
8+
value?: { [key: string]: number | string },
9+
/** Short alias, if any. */
10+
alias?: string
11+
}
12+
113
/** Configuration object. */
214
interface Config {
3-
[key: string]: {
4-
/** Textual description. */
5-
description?: string | string[],
6-
/** Data type. One of (b)oolean [default], (i)nteger, (f)loat or (s)tring. Uppercase means multiple values. */
7-
type?: "b" | "i" | "f" | "s", "I", "F", "S",
8-
/** Substituted options, if any. */
9-
value?: { [key: string]: number | string },
10-
/** Short alias, if any. */
11-
alias?: string
12-
};
15+
[key: string]: OptionDescription;
1316
}
1417

1518
/** Parsing result. */

0 commit comments

Comments
 (0)