Skip to content

Instantly share code, notes, and snippets.

@0x1ad2
Created July 26, 2019 09:52
Show Gist options
  • Select an option

  • Save 0x1ad2/7a129fae6be1f54b6c4a271f3f8f600e to your computer and use it in GitHub Desktop.

Select an option

Save 0x1ad2/7a129fae6be1f54b6c4a271f3f8f600e to your computer and use it in GitHub Desktop.

Revisions

  1. Dennis Bruijn created this gist Jul 26, 2019.
    17 changes: 17 additions & 0 deletions power-cli.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    // require the enquirer module
    const { MultiSelect } = require("enquirer");

    // create a new multi select prompt
    const multiSelectPrompt = new MultiSelect({
    name: "value",
    message: "Select all the binaries that you want to install",
    choices: frequentlyUsedBinaries
    });

    // run the prompt and handle the answer
    multiSelectPrompt
    .run()
    .then(binaries => {
    console.log("Selected binaries:", binaries);
    })
    .catch(console.error);