2

typing:

zsh --help

gives me the expected:

Usage: zsh [<options>] [<argument> ...]

Special options:
  --help     show this message, then exit
  --version  show zsh version number, then exit
  -b         end option processing, like --
  -c         take first argument as a command to execute
  -o OPTION  set an option by name (see below)

...

but when i try:

date --help

it make a no bueno:

date: illegal option -- -
usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ... 
            [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
  • 1
    Arguments are processed by each command, not the shell. `date --help` fails whether you run it from `zsh` or `bash` (at least, for the `date` that ships with macOS; GNU `date`, which you might have installed separately, *does* support `--help`. Different `PATH` values could explain why you might see different behavior between two shells.) – chepner Dec 03 '19 at 12:46
  • 1
    maybe if I understood how commands call --help I could ask this better. Could you point me to how I can fix the path so that this works again, basically I don't want to have to read the whole man file when smaller summaries exist but I'm unable to access them the way I used to in bash. – Fadhl Al Eryani Dec 03 '19 at 16:40
  • Commands don't "call" `--help`; it's just an ordinary argument that each command is free to interpret as it likes. Some commands provide help via `-h`, other `--help`, still others using different arguments (`-?` is one that comes to mind). Some commands don't provide *anything*; there is no hard and fast standard for providing brief summaries of usage. – chepner Dec 03 '19 at 16:45
  • Here, though, did `date --help` *ever* work on your machine? That would have required you to have installed GNU `date` yourself and to have a `PATH` value that listed the directory containing GNU `date` before `/bin`. – chepner Dec 03 '19 at 16:47
  • here is a virtual environment set up that does exactly that https://mybinder.org/v2/gh/AstrobioMike/binder-bash-intro/master?urlpath=lab .. is it possible that commands in different shells interpret the help arguments differently? I was using date as an example for a whole lot of commands that give the help i want on the environment i shared, but not in my new zsh terminal Are you saying that if the path for the command is before /bin it would work?? – Fadhl Al Eryani Dec 03 '19 at 19:59
  • @Fadhl Al Eryani Read through `man zshcontrib`. Unfortunately the utility they mention that creates help files does not exist on macOS unless you build your own zsh from the distribution. Look in `/usr/share/zsh` – John Oct 22 '21 at 17:42

0 Answers0