Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: functions/Completion/Linux/_modutils
- X-seq: zsh-workers 25032
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: functions/Completion/Linux/_modutils
- Date: Wed, 14 May 2008 09:40:46 -0700
- In-reply-to: <482B1123.5050206@xxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <4829BF7A.20203@xxxxxxxxxxxxx> <080513201714.ZM10079@xxxxxxxxxxxxxxxxxxxxxx> <482AF445.3080909@xxxxxxxxxxxxx> <080514085511.ZM11897@xxxxxxxxxxxxxxxxxxxxxx> <482B1123.5050206@xxxxxxxxxxxxx>
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