Skip to main content
Deno 2 is finally here ๐ŸŽ‰๏ธ
Learn more
Module

x/denops_std/argument/flags.ts>formatFlag

๐Ÿ“š Standard module for denops.vim
Latest
function formatFlag
import { formatFlag } from "https://deno.land/x/denops_std@v6.5.1/argument/flags.ts";

Format key and value to construct string array.

import type { Entrypoint } from "https://deno.land/x/denops_std@v6.5.1/mod.ts";
import { formatFlag } from "https://deno.land/x/denops_std@v6.5.1/argument/mod.ts";

export const main: Entrypoint = async (denops) => {
  console.log(formatFlag("f", ""));
  // "-f"

  console.log(formatFlag("foo", "value"));
  // "--foo=value"
}

Parameters

key: string
value: string | string[] | undefined

Returns

string[]