How to use the assemblyscript/cli/util/options.parse function in assemblyscript

To help you get started, we’ve selected a few assemblyscript examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github AssemblyScript / node / tests / node.js View on Github external
const { TestContext, EmptyReporter } = require("@as-pect/core");
const { instantiateBuffer } = require("assemblyscript/lib/loader");
const glob = require("glob");
const { main } = require("assemblyscript/cli/asc");
const { parse } = require("assemblyscript/cli/util/options");
const path = require("path");
const fs = require("fs");
const Wasi = require("wasi");
const wasi = new Wasi({});
const diff = require("diff");

const options = parse(process.argv.slice(2), {
  "help": {
    "description": "Prints this message and exits.",
    "type": "b",
    "alias": "h"
  },
  "updateFixtures": {
    "description": "Update the test fixtures.",
    "type": "b",
    "alias": "u"
  },
});

if (options.unknown.length > 1) {
  console.error("Unknown options arguments: " + options.unknown.join(" "));
  process.exit(1);
}