Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] sudo strace -e <TAB>



On Mar 7,  4:27am, Daniel Shahaf wrote:
} Subject: [PATCH] sudo strace -e <TAB>
}
} Is there a smarter way to detect whether -e was passed to sudo?

Perhaps

    (( $words[(i)-e] < $words[(i)[^-]*] ))

would do?  That is, the -e appears before the first word that doesn't
begin with a hyphen.  The way (i) works in subscripts, the above will
always be true if all the words begin with a hyphen.

A slight tweak might fix the problem with -Ae not working:

    (( $words[(i)-(e|Ae)] < $words[(i)[^-]*] ))



Messages sorted by: Reverse Date, Date, Thread, Author