zsh-workers
 help / color / mirror / code / Atom feed
* Help command behavior with aliases
@ 2005-02-28 18:14 Sławek Żak
  2005-02-28 19:00 ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Sławek Żak @ 2005-02-28 18:14 UTC (permalink / raw)
  To: Zsh Workers

Hi,

When aliasing a command and running it from CLI, help for the command
(Escape-H) is called for alias expansion, like in:

% portupgrade zsh (type Esc-H)
<manpage for nice appears if you do alias portupgrade='nice portupgrade'>

Strange and unpleasant as well. Any reason to keep it this way?

/S


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Help command behavior with aliases
  2005-02-28 18:14 Help command behavior with aliases Sławek Żak
@ 2005-02-28 19:00 ` Bart Schaefer
       [not found]   ` <787bbe1c05022812417b32e471@mail.gmail.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Bart Schaefer @ 2005-02-28 19:00 UTC (permalink / raw)
  To: Zsh Workers

On Feb 28,  7:14pm, ( Text in unknown character set UTF-8 not shown ) wrote:
}
} When aliasing a command and running it from CLI, help for the command
} (Escape-H) is called for alias expansion, like in:
} 
} % portupgrade zsh (type Esc-H)
} <manpage for nice appears if you do alias portupgrade='nice portupgrade'>
} 
} Strange and unpleasant as well. Any reason to keep it this way?

Suppose you have

  alias LL='ls -lL'

Do you want run-help to display the man page for "ls", or do you want it
to simply fail because there is no LL command?

However, it's probably possible to rewrite the run-help function so that
it skips command prefixes (coproc, nice, time, etc.) in alias expansions
and displays the help for the following word instead.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Fwd: Help command behavior with aliases
       [not found]   ` <787bbe1c05022812417b32e471@mail.gmail.com>
@ 2005-03-02  8:13     ` Sławek Żak
  2005-03-11  6:26       ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Sławek Żak @ 2005-03-02  8:13 UTC (permalink / raw)
  To: Zsh Workers

Mistakenly sent in private mail to Bart. Can you help?

/S


---------- Forwarded message ----------
From: Sławek Żak <slawek.zak@gmail.com>
Date: Mon, 28 Feb 2005 21:41:35 +0100
Subject: Re: Help command behavior with aliases
To: Bart Schaefer <schaefer@brasslantern.com>


On Mon, 28 Feb 2005 19:00:35 +0000, Bart Schaefer
<schaefer@brasslantern.com> wrote:
> On Feb 28,  7:14pm, ( Text in unknown character set UTF-8 not shown ) wrote:
> }
> } When aliasing a command and running it from CLI, help for the command
> } (Escape-H) is called for alias expansion, like in:
> }
> } % portupgrade zsh (type Esc-H)
> } <manpage for nice appears if you do alias portupgrade='nice portupgrade'>
> }
> } Strange and unpleasant as well. Any reason to keep it this way?
>
> Suppose you have
>
>   alias LL='ls -lL'
>
> Do you want run-help to display the man page for "ls", or do you want it
> to simply fail because there is no LL command?
>
> However, it's probably possible to rewrite the run-help function so that
> it skips command prefixes (coproc, nice, time, etc.) in alias expansions
> and displays the help for the following word instead.
>

Doh,

You're right. I've got a friend aliasing vi to v. I should've thought
of it. All the aliases I use indeed are just innocuous prefixes to
standard commands, or options I like for the commands to save me some
typing. Could you explain, how to change run-help behavior?

As a side note, I used to like and use compctl in the old days of 3.x.
Now the powerful-completion-engine NT seems to be the thing. I had an
alias which let me use

% stop apache

this would run /usr/local/etc/rc.d/apache.sh stop, *and* complete
apache grokking the whole path (two paths actually, /etc/rc.d and the
above).

Can I get the completion part easily now?

Thanks for your swift response, /S


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Fwd: Help command behavior with aliases
  2005-03-02  8:13     ` Fwd: " Sławek Żak
@ 2005-03-11  6:26       ` Bart Schaefer
  0 siblings, 0 replies; 4+ messages in thread
From: Bart Schaefer @ 2005-03-11  6:26 UTC (permalink / raw)
  To: Zsh Workers

} Could you explain, how to change run-help behavior?

Turns out I was wrong about this.  The alias is expanded internally to
ZLE before the run-help function is ever called, so the alias branch of
the run-help case statement is wasted.  Bothersome.

} I had an alias which let me use
} 
} % stop apache
} 
} this would run /usr/local/etc/rc.d/apache.sh stop, *and* complete
} apache grokking the whole path (two paths actually, /etc/rc.d and the
} above).
} 
} Can I get the completion part easily now?

I'm afraid I don't understand the question, in that I don't see where
completion is involved.  Can you give an example?  What's the input
before you press TAB, and what do you expect to see afterward?

} Thanks for your swift response, /S

Sorry it was so much less swift this time.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-03-11  6:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-28 18:14 Help command behavior with aliases Sławek Żak
2005-02-28 19:00 ` Bart Schaefer
     [not found]   ` <787bbe1c05022812417b32e471@mail.gmail.com>
2005-03-02  8:13     ` Fwd: " Sławek Żak
2005-03-11  6:26       ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).