zsh-users
 help / color / mirror / code / Atom feed
* command name '-'
@ 2015-02-08 17:48 Daniel
  2015-02-08 17:55 ` Eric Cook
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel @ 2015-02-08 17:48 UTC (permalink / raw)
  To: zsh-users

I have in my ~/bin, which is in PATH, a command named simply '-' [minus]. I
can't seem to have this one executed. Typing - at the prompt and nothing
happens. Also, whence or type yiels exactly nothing. What gives?

I like to have + and - commands for changing volume easily in console, over
ssh, however...


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

* Re: command name '-'
  2015-02-08 17:48 command name '-' Daniel
@ 2015-02-08 17:55 ` Eric Cook
  2015-02-08 18:38   ` Daniel
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Cook @ 2015-02-08 17:55 UTC (permalink / raw)
  To: zsh-users

On 02/08/2015 12:48 PM, Daniel wrote:
> I have in my ~/bin, which is in PATH, a command named simply '-' [minus]. I
> can't seem to have this one executed. Typing - at the prompt and nothing
> happens. Also, whence or type yiels exactly nothing. What gives?
>
> I like to have + and - commands for changing volume easily in console, over
> ssh, however...
>
- and -- act as end of options for a lot of builtin commands, including
whence. so you want: whence - -

`-' is a precommand modifier that you can read about in zshbuiltins, but
you can disable it using the `disable'  builtin.
Again using: disable - -


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

* Re: command name '-'
  2015-02-08 17:55 ` Eric Cook
@ 2015-02-08 18:38   ` Daniel
  2015-02-09  9:40     ` Peter Stephenson
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel @ 2015-02-08 18:38 UTC (permalink / raw)
  To: zsh-users

Ah, I understand. And thanks for the info on disabling it, it's not obvious
from reading under "disable" under SHELL BUILTIN COMMANDS in man
zshbuiltins.


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

* Re: command name '-'
  2015-02-08 18:38   ` Daniel
@ 2015-02-09  9:40     ` Peter Stephenson
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Stephenson @ 2015-02-09  9:40 UTC (permalink / raw)
  To: zsh-users

On Sun, 8 Feb 2015 18:38:22 +0000
Daniel <quite@hack.org> wrote:
> Ah, I understand. And thanks for the info on disabling it, it's not obvious
> from reading under "disable" under SHELL BUILTIN COMMANDS in man
> zshbuiltins.

If you mean the problem with quoting the '-', it's generic to builins
(and not just builtins) so it's described at the top of that section.

   All  builtin  commands other than precommand modifiers, even those that
   have no options, can be given the argument  `--'  to  terminate  option
   processing.   This  indicates  that  the following words are non-option
   arguments, but is otherwise ignored.  This is  useful  in  cases  where
   arguments  to  the command may begin with `-'.  For historical reasons,
   most builtin commands also recognize a single `-' in  a  separate  word
   for  this  purpose;  note  that this is less standard and use of `-- is
   recommended.

pws


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

end of thread, other threads:[~2015-02-09  9:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-08 17:48 command name '-' Daniel
2015-02-08 17:55 ` Eric Cook
2015-02-08 18:38   ` Daniel
2015-02-09  9:40     ` Peter Stephenson

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).