Thread: [Bashburn-info] A historical idea to throw out :-)
Brought to you by:
bashburn
|
From: Steven W. O. <st...@sy...> - 2008-09-17 18:32:22
|
There are some places in bb where we throw a prompt and ask the user for input, where there are a set of choices that would make sense for the user to type in. I'm not talking about completion. Here's an example (and there are many others): +--------------+ | BashBurn 3.0 | +--------------+ | +--------------+ INFORMATION +--------------+ This option sets the language BashBurn's interface will be shown in. The current setting is: English, and below is a list of possible languages to choose from. To cancel, just press [ENTER]. +--------------+ INFORMATION +--------------+ Czech English German Italian Norwegian Polish Spanish Swedish +--------------+-------------+--------------+ Your Choice? |> Wouldn't it be nice for the user to be able to hit ^P or UpArrow and be able to cycle through the only choices that are available? I just found out how to do it. (Highly abbreviated example code.) ls > tmpfile history -c history -r tmpfile read -r -p 'Your choice? |> ' Does anyone hate this? -- Time flies like the wind. Fruit flies like a banana. Stranger things have .0. happened but none stranger than this. Does your driver's license say Organ ..0 Donor?Black holes are where God divided by zero. Listen to me! We are all- 000 individuals! What if this weren't a hypothetical question? steveo at syslang.net |
|
From: Markus K. <mar...@on...> - 2008-09-17 18:58:31
|
Steven W. Orr schrieb: > There are some places in bb where we throw a prompt and ask the user for > input, where there are a set of choices that would make sense for the user > to type in. I'm not talking about completion. Here's an example (and > there are many others): > > +--------------+ > | BashBurn 3.0 | > +--------------+ > | > +--------------+ INFORMATION +--------------+ > This option sets the language BashBurn's interface will be shown in. > The current setting is: English, and below is a list > of possible languages to choose from. > To cancel, just press [ENTER]. > +--------------+ INFORMATION +--------------+ > > Czech English German Italian Norwegian Polish Spanish Swedish > > +--------------+-------------+--------------+ > > Your Choice? |> > > Wouldn't it be nice for the user to be able to hit ^P or UpArrow and be > able to cycle through the only choices that are available? > > I just found out how to do it. (Highly abbreviated example code.) > > ls > tmpfile > history -c > history -r tmpfile > read -r -p 'Your choice? |> ' > > Does anyone hate this? > > Oh, I think this i a great advantage! Steven your are great! :-) Maybe we should then backup the prior contents of the history file, so that after exiting bashburn the user has the history as it was before starting bashburn. Markus |
|
From: Steven W. O. <st...@sy...> - 2008-09-17 19:30:36
|
On Wednesday, Sep 17th 2008 at 14:56 -0000, quoth Markus Kollmar: =>Steven W. Orr schrieb: =>> There are some places in bb where we throw a prompt and ask the user for =>> input, where there are a set of choices that would make sense for the user =>> to type in. I'm not talking about completion. Here's an example (and =>> there are many others): =>> =>> +--------------+ =>> | BashBurn 3.0 | =>> +--------------+ =>> | =>> +--------------+ INFORMATION +--------------+ =>> This option sets the language BashBurn's interface will be shown in. =>> The current setting is: English, and below is a list =>> of possible languages to choose from. =>> To cancel, just press [ENTER]. =>> +--------------+ INFORMATION +--------------+ =>> =>> Czech English German Italian Norwegian Polish Spanish Swedish =>> =>> +--------------+-------------+--------------+ =>> =>> Your Choice? |> =>> =>> Wouldn't it be nice for the user to be able to hit ^P or UpArrow and be =>> able to cycle through the only choices that are available? =>> =>> I just found out how to do it. (Highly abbreviated example code.) =>> =>> ls > tmpfile =>> history -c =>> history -r tmpfile =>> read -r -p 'Your choice? |> ' =>> =>> Does anyone hate this? =>> =>> =>Oh, I think this i a great advantage! Steven your are great! :-) => =>Maybe we should then backup the prior contents of the history file, so =>that after exiting bashburn the user has the history as it was before =>starting bashburn. Interesting suggestion. The problem is that it's sort of like a cummerbund or a vest. You only get to choose one. ;-) What we can do is to create a ~/.bashburn_history which would contain all of the history items that get gen'd *except* for the entries that would happen on input that expected some sort of possible enumeration. -- steveo at syslang dot net TMMP1 http://frambors.syslang.net/ Do you have neighbors who are not frambors? Steve Orr Who should we vote for? http://steveo.syslang.net/electionrec-2008.5/ |
|
From: Anders L. <and...@gm...> - 2008-09-17 19:55:42
|
ons 2008-09-17 klockan 14:32 -0400 skrev Steven W. Orr: > There are some places in bb where we throw a prompt and ask the user for > input, where there are a set of choices that would make sense for the user > to type in. I'm not talking about completion. Here's an example (and > there are many others): > > +--------------+ > | BashBurn 3.0 | > +--------------+ > | > +--------------+ INFORMATION +--------------+ > This option sets the language BashBurn's interface will be shown in. > The current setting is: English, and below is a list > of possible languages to choose from. > To cancel, just press [ENTER]. > +--------------+ INFORMATION +--------------+ > > Czech English German Italian Norwegian Polish Spanish Swedish > > +--------------+-------------+--------------+ > > Your Choice? |> > > Wouldn't it be nice for the user to be able to hit ^P or UpArrow and be > able to cycle through the only choices that are available? > > I just found out how to do it. (Highly abbreviated example code.) > > ls > tmpfile > history -c > history -r tmpfile > read -r -p 'Your choice? |> ' > > Does anyone hate this? > Sound good to me. Simpler and no chance of misspellings. Go for it. -- Anders Lindén http://bashburn.sf.net |