import { validateOpts } from "https://deno.land/x/denops_std@v6.5.1/argument/mod.ts";
Validate if opts
has unknown attributes.
import type { Entrypoint } from "https://deno.land/x/denops_std@v6.5.1/mod.ts";
import { builtinOpts, parse, validateOpts } from "https://deno.land/x/denops_std@v6.5.1/argument/mod.ts";
export const main: Entrypoint = async (denops) => {
const args = [
"++enc=sjis",
"++ff=dos",
"-f",
"--foo=foo",
"--bar=bar",
"--bar=baz",
"hello",
"world",
];
const [opts, _flags, residues] = parse(args);
validateOpts(opts, ["enc", "ff"]);
// Or use `builtinOpts` to validate Vim's builtin `++opts`
validateOpts(opts, builtinOpts);
}
Parameters
opts: Opts