It's open source, and the basic logic isn't very complicated, so you could always just modify it.
Put the following lines into a file (say, choose.diff
) in the same directory as choose
, then run patch -p1 < choose.diff
:
--- a/choose
+++ b/choose
@@ -164,8 +164,8 @@ def do_it(auswahl):
index = select_entry(auswahl,
header_text=u'Navigate by pressing ↑ and ↓, select by pressing Enter')
- # print chosen string
- print(orig_auswahl[index])
+ # return chosen string
+ return orig_auswahl[index]
if __name__=="__main__":
@@ -179,7 +179,7 @@ if __name__=="__main__":
sys.__stdin__ = sys.stdin = open('/dev/tty')
os.dup2(sys.stdin.fileno(), 0)
- do_it(auswahl)
+ choice = do_it(auswahl)
#restore old stdout
sys.stdout.flush()
@@ -190,3 +190,5 @@ if __name__=="__main__":
sys.__stdout__ = sys.stdout = old_out
sys.__stdin__ = sys.stdin = old_in
sys.__stderr__ = sys.stderr = old_err
+
+ print choice
There's also a completely shell based solution to this problem (currently only single line select as well): Sentaku
– Orangenhain – 2014-04-30T16:11:08.273