Skip to main content
Module

x/denops_std/argument/opts.ts>formatOpts

📚 Standard module for denops.vim
Go to Latest
function formatOpts
import { formatOpts } from "https://deno.land/x/denops_std@v5.0.2/argument/opts.ts";

Format opts to construct string array.

import { Denops } from "../mod.ts";
import { formatOpts, parse } from "../argument/mod.ts";

export async function main(denops: Denops): Promise<void> {
  const args = [
    "++enc=sjis",
    "++ff=dos",
    "-f",
    "--foo=foo",
    "--bar=bar",
    "--bar=baz",
    "hello",
    "world",
  ];
  const [opts, _flags, _residues] = parse(args);

  console.log(formatOpts(opts));
  // "++enc=sjis ++ff=dos"
}

Parameters

opts: Opts
optional
includes: string[]

Returns

string[]