Skip to content

Categorize CLI options #1086

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
229 changes: 133 additions & 96 deletions cli/asc.json
Original file line number Diff line number Diff line change
@@ -1,181 +1,218 @@
{
"version": {
"category": "General",
"description": "Prints just the compiler's version and exits.",
"type": "b",
"alias": "v"
},
"help": {
"category": "General",
"description": "Prints this message and exits.",
"type": "b",
"alias": "h"
},
"noColors": {
"category": "General",
"description": "Disables terminal colors.",
"type": "b",
"default": false
},

"optimize": {
"category": "Optimization",
"description": [
"Optimizes the module. Also has the usual shorthands:",
"Optimizes the module. Typical shorthands are:",
"",
" -O Uses defaults. Equivalent to -O3s",
" -O0 Equivalent to --optimizeLevel 0",
" -O1 Equivalent to --optimizeLevel 1",
" -O2 Equivalent to --optimizeLevel 2",
" -O3 Equivalent to --optimizeLevel 3",
" -Oz Equivalent to -O but with --shrinkLevel 2",
" -O3s Equivalent to -O3 with --shrinkLevel 1 etc.",
" Default optimizations -O / -O3s",
" Make a release build -O --noAssert",
" Make a debug build --debug",
" Optimize for speed -O3",
" Optimize for size -O3z --converge",
""
],
"type": "b",
"alias": "O"
},
"optimizeLevel": {
"category": "Optimization",
"description": "How much to focus on optimizing code. [0-3]",
"type": "i"
},
"shrinkLevel": {
"category": "Optimization",
"description": "How much to focus on shrinking code size. [0-2, s=1, z=2]",
"type": "i"
},
"converge": {
"category": "Optimization",
"description": "Re-optimizes until no further improvements can be made.",
"type": "b",
"default": false
},
"validate": {
"description": "Validates the module using Binaryen. Exits if invalid.",
"noAssert": {
"category": "Optimization",
"description": "Replaces assertions with just their value without trapping.",
"type": "b",
"alias": "c",
"default": false
},
"baseDir": {
"description": "Specifies the base directory of input and output files.",
"runtime": {
"category": "Optimization",
"description": [
"Specifies the runtime variant to include in the program.",
"",
" full Default runtime based on TLSF and reference counting.",
" half Same as 'full', but not exported to the host.",
" stub Minimal stub implementation without free/GC support.",
" none Same as 'stub', but not exported to the host.",
""
],
"type": "s",
"default": "."
"default": "full"
},

"outFile": {
"category": "Output",
"description": "Specifies the output file. File extension indicates format.",
"type": "s",
"alias": "o"
},
"binaryFile": {
"category": "Output",
"description": "Specifies the binary output file (.wasm).",
"type": "s",
"alias": "b"
},
"textFile": {
"category": "Output",
"description": "Specifies the text output file (.wat).",
"type": "s",
"alias": "t"
},
"asmjsFile": {
"category": "Output",
"description": "Specifies the asm.js output file (.js).",
"type": "s",
"alias": "a"
},
"idlFile": {
"category": "Output",
"description": "Specifies the WebIDL output file (.webidl).",
"type": "s",
"alias": "i"
},
"tsdFile": {
"category": "Output",
"description": "Specifies the TypeScript definition output file (.d.ts).",
"type": "s",
"alias": "d"
},

"sourceMap": {
"category": "Debugging",
"description": [
"Enables source map generation. Optionally takes the URL",
"used to reference the source map from the binary file."
],
"type": "s"
},
"runtime": {
"description": [
"Specifies the runtime variant to include in the program.",
"",
" full Default runtime based on TLSF and reference counting.",
" half Same as 'full', but not exported to the host.",
" stub Minimal stub implementation without free/GC support.",
" none Same as 'stub', but not exported to the host.",
""
],
"type": "s",
"default": "full"
},
"noUnsafe": {
"description": [
"Disallows the use of unsafe features in user code.",
"Does not affect library files and external modules."
],
"type": "b",
"default": false
},
"debug": {
"category": "Debugging",
"description": "Enables debug information in emitted binaries.",
"type": "b",
"default": false
},
"noAssert": {
"description": "Replaces assertions with just their value without trapping.",
"type": "b",
"default": false
},
"noEmit": {
"description": "Performs compilation as usual but does not emit code.",
"type": "b",
"default": false
},

"importMemory": {
"category": "Features",
"description": "Imports the memory provided as 'env.memory'.",
"type": "b",
"default": false
},
"sharedMemory": {
"category": "Features",
"description": "Declare memory as shared by settings the max shared memory.",
"type": "i",
"default": 0
},
"memoryBase": {
"description": "Sets the start offset of compiler-generated static memory.",
"type": "i",
"default": 0
},
"importTable": {
"category": "Features",
"description": "Imports the function table provided as 'env.table'.",
"type": "b",
"default": false
},
"exportTable": {
"category": "Features",
"description": "Exports the function table as 'table'.",
"type": "b",
"default": false
},
"explicitStart": {
"description": "Exports an explicit start function to be called manually.",
"category": "Features",
"description": "Exports an explicit '_start' function to call.",
"type": "b",
"default": false
},
"lib": {
"enable": {
"category": "Features",
"description": [
"Adds one or multiple paths to custom library components and",
"uses exports of all top-level files at this path as globals."
"Enables WebAssembly features being disabled by default.",
"",
" sign-extension Sign-extension operations",
" bulk-memory Bulk memory operations.",
" simd SIMD types and operations.",
" threads Threading and atomic operations.",
" reference-types Reference types and operations.",
""
],
"type": "s"
"TODO_doesNothingYet": [
" nontrapping-f2i Non-trapping float to integer ops.",
" exception-handling Exception handling.",
" tail-calls Tail call operations."
],
"type": "S"
},
"path": {
"disable": {
"category": "Features",
"description": [
"Adds one or multiple paths to package resolution, similar",
"to node_modules. Prefers an 'ascMain' entry in a package's",
"package.json and falls back to an inner 'assembly/' folder."
"Disables WebAssembly features being enabled by default.",
"",
" mutable-globals Mutable global imports and exports.",
""
],
"type": "S"
},
"use": {
"category": "Features",
"description": [
"Aliases a global object under another name, e.g., to switch",
"the default 'Math' implementation used: --use Math=JSMath"
"the default 'Math' implementation used: --use Math=JSMath",
"Can also be used to introduce an integer constant."
],
"type": "S",
"alias": "u"
},
"memoryBase": {
"category": "Features",
"description": "Sets the start offset of compiler-generated static memory.",
"type": "i",
"default": 0
},

"transform": {
"category": "API",
"description": "Specifies the path to a custom transform to 'require'.",
"type": "S"
},

"validate": {
"category": "Binaryen",
"description": "Validates the module using Binaryen. Exits if invalid.",
"type": "b",
"alias": "c",
"default": false
},
"trapMode": {
"category": "Binaryen",
"description": [
"Sets the trap mode to use.",
"",
Expand All @@ -188,48 +225,57 @@
"default": "allow"
},
"runPasses": {
"category": "Binaryen",
"description": [
"Specifies additional Binaryen passes to run after other",
"optimizations, if any. See: Binaryen/src/passes/pass.cpp"
],
"type": "s"
},
"enable": {
"description": [
"Enables WebAssembly features that are disabled by default.",
"",
" sign-extension Sign-extension operations",
" bulk-memory Bulk memory operations.",
" simd SIMD types and operations.",
" threads Threading and atomic operations.",
" reference-types Reference types and operations.",
""
],
"TODO_doesNothingYet": [
" nontrapping-f2i Non-trapping float to integer ops.",
" exception-handling Exception handling.",
" tail-calls Tail call operations."
],
"type": "S"

"baseDir": {
"description": "Specifies the base directory of input and output files.",
"type": "s",
"default": "."
},
"disable": {
"noUnsafe": {
"description": [
"Disables WebAssembly features that are enabled by default.",
"",
" mutable-globals Mutable global imports and exports.",
""
"Disallows the use of unsafe features in user code.",
"Does not affect library files and external modules."
],
"type": "S"
"type": "b",
"default": false
},
"transform": {
"description": "Specifies the path to a custom transform to 'require'.",
"type": "S"
"noEmit": {
"description": "Performs compilation as usual but does not emit code.",
"type": "b",
"default": false
},
"measure": {
"description": "Prints measuring information on I/O and compile times.",
"type": "b",
"default": false
},
"pedantic": {
"description": "Make yourself sad for no good reason.",
"type": "b",
"default": false
},
"lib": {
"description": [
"Adds one or multiple paths to custom library components and",
"uses exports of all top-level files at this path as globals."
],
"type": "s"
},
"path": {
"description": [
"Adds one or multiple paths to package resolution, similar",
"to node_modules. Prefers an 'ascMain' entry in a package's",
"package.json and falls back to an inner 'assembly/' folder."
],
"type": "S"
},
"traceResolution": {
"description": "Enables tracing of package resolution.",
"type": "b",
Expand All @@ -240,24 +286,15 @@
"type": "b",
"default": false
},
"measure": {
"description": "Prints measuring information on I/O and compile times.",
"type": "b",
"default": false
},
"printrtti": {
"description": "Prints the module's runtime type information to stderr.",
"type": "b",
"default": false
},
"noColors": {
"description": "Disables terminal colors.",
"type": "b",
"default": false
},
" ...": {
"description": "Specifies node.js options (CLI only). See: node --help"
},

"-Os": { "value": { "optimize": true, "shrinkLevel": 1 } },
"-Oz": { "value": { "optimize": true, "shrinkLevel": 2 } },
"-O0": { "value": { "optimizeLevel": 0, "shrinkLevel": 0 } },
Expand Down
Loading