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

Re: functions/Completion/Linux/_modutils



On May 14,  8:19pm, sergio wrote:
}
} > % zstyle :complete:sudo: environ \
} >     PATH="/sbin:/usr/sbin:$PATH" HOME="/root"
} > % sudo modprobe <TAB>
} Hmm.. How zsh searches command when I type 'sudo <TAB>'
} It will be better to get $path from that logic.

That just calls _command_names, which doesn't do anything magical at
all; in fact I'd expect it not to find modprobe if calling modprobe
later will fail for path reasons.  The path needs to be set where I
set it in that patch, before any completers are invoked.

} > Of course it would be preferable if "sudo -H /tmp/foo" would export
} > HOME=/tmp/foo, and if the style could be specialized to the target
} > user for "sudo -u" and so on, but I'm not prepared to go that far
} > overboard just now.
} But it's not very difficult.. ? (:

It means dismantling the simple _arguments call into something that uses
state transitions to capture values as each argument is examined.

I don't believe that's worth the effort (it's certainly not worth *my*
effort, as I'm perfectly happy with the way it's been working for the
last seven years).



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