Connor Lane Smith <c...@lubutu.com> writes:

> Hey,
>
> On 11/05/2010, Martin Ellis <ellis...@gmail.com> wrote:
>> We had a strange situation where putting the menu in stdin was difficult.
>>
>> For our situation supplying the menu on the command line would be easier.
>>
>> Attached is a patch that provides this.
>
> I wrote one similar to this, except each argument after the flags is a
> menu item, and it's only +3 LOC. I'm not sure why you need a delimiter
> and such, but maybe this patch works for your situation.
>
> The diff is against tip, since we're real close to releasing 4.1 anyway.
>
> Thanks,
> cls
>

Why not just use a simple wrapper script?  I'm not very good at bourne
shell, but this works:

#!/bin/sh

cmd=dmenu

while [ $# -gt 0 ]; do
    case $1 in
        -m) shift;
            for elem in "$@"; do
                echo $elem
            done | $cmd && exit 0;;
        *)  cmd="$cmd $1";;
    esac
    shift
done

-- 
\  Troels
/\ Henriksen

Reply via email to