2023-06-20 10:37:55 +02:00
|
|
|
# Using spmenu to parse text
|
2023-06-06 22:00:51 +02:00
|
|
|
|
|
|
|
spmenu itself accepts standard input and this is a fact all scripts/programs
|
|
|
|
written for spmenu depend on. It's a core feature of spmenu. Nearly all of
|
|
|
|
spmenu's features require standard input to be passed. If you only want to
|
|
|
|
return the input text, you can simply pass nothing to spmenu and a blank
|
|
|
|
menu will open up.
|
|
|
|
|
|
|
|
For example, `printf "Apple\nBanana\nOrange\n" | spmenu` will bring up a basic
|
|
|
|
menu listing with three options, Apple, Banana and Orange. The one the user
|
|
|
|
selects will be returned when (by default) Enter is pressed. You can also press
|
|
|
|
Shift+Enter to select what you have typed in rather than the selected match.
|
|
|
|
|
|
|
|
spmenu also has a lot of arguments you can give. `spmenu --help` or if you
|
|
|
|
prefer, `spmenu -h` will return a full list of available arguments. This is not
|
|
|
|
the *only* way to configure spmenu, however it's useful when you want a setting
|
|
|
|
to be applied only to the current instance. Most options are configurable
|
|
|
|
through arguments, but not all of them are.
|