Nushell
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
GitHub
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
GitHub
  • Categories

    • Bits
    • Bytes
    • Chart
    • Conversions
    • Core
    • Database
    • Dataframe
    • Dataframe Or Lazyframe
    • Date
    • Debug
    • Default
    • Env
    • Experimental
    • Expression
    • Filesystem
    • Filters
    • Formats
    • Generators
    • Hash
    • History
    • Lazyframe
    • Math
    • Misc
    • Network
    • Path
    • Platform
    • Plugin
    • Prompt
    • Random
    • Removed
    • Shells
    • Strings
    • System
    • Viewers

input list for platform

Interactive list selection.

Signature

> input list {flags} (prompt)

Flags

  • --multi, -m: Use multiple results, you can press a to toggle all options on/off
  • --fuzzy, -f: Use a fuzzy select.
  • --index, -i: Returns list indexes.
  • --display, -d {cell-path}: Field to use as display value

Parameters

  • prompt: The prompt to display.

Input/output types:

inputoutput
list<any>any
rangeint

Examples

Return a single value from a list

> [1 2 3 4 5] | input list 'Rate it'

Return multiple values from a list

> [Banana Kiwi Pear Peach Strawberry] | input list --multi 'Add fruits to the basket'

Return a single record from a table with fuzzy search

> ls | input list --fuzzy 'Select the target'

Choose an item from a range

> 1..10 | input list

Return the index of a selected item

> [Banana Kiwi Pear Peach Strawberry] | input list --index

Choose an item from a table using a column as display value

> [[name price]; [Banana 12] [Kiwi 4] [Pear 7]] | input list -d name

Notes

Abort with esc or q.