Homebrew / install

📥 Homebrew (un)installer
https://brew.sh
BSD 2-Clause "Simplified" License
2.15k stars 1.02k forks source link

doc: add `install.sh --help`. Fix #790 #794

Closed osalbahr closed 1 year ago

osalbahr commented 1 year ago

Adapted from uninstall.sh:

$ ./install.sh --help
Homebrew Installer
Usage: [NONINTERACTIVE=1] [CI=1] ./install.sh [options]
    -h, --help       Display this message.
    NONINTERACTIVE   Install without prompting.
    CI               Imply NONINTERACTIVE.
$ ./install.sh -h    
Homebrew Installer
Usage: [NONINTERACTIVE=1] [CI=1] ./install.sh [options]
    -h, --help       Display this message.
    NONINTERACTIVE   Install without prompting.
    CI               Imply NONINTERACTIVE.
$ ./install.sh --foo
Warning: Unrecognized option: '--foo'
Homebrew Installer
Usage: [NONINTERACTIVE=1] [CI=1] ./install.sh [options]
    -h, --help       Display this message.
    NONINTERACTIVE   Install without prompting.
    CI               Imply NONINTERACTIVE.

I didn't modify the README since it already mentions the only supported option.

ShellCheck complained about the shift (unreachable), so I commented it out. I didn't remove it to make it easier in case a new option gets added in the future.

The ShellCheck warning:

$ shellcheck install.sh 

In install.sh line 99:
  shift # Command appears to be unreachable. Check usage (or ignore if invoked indirectly). shellcheck (SC2317)
  ^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).

For more information:
  https://www.shellcheck.net/wiki/SC2317 -- Command appears to be unreachable...

Note: I assumed CI and NONINTERACTIVE are interchangeable. There was a closed issue that was solved by setting CI=1 and I don't know if NONINTERACTIVE=1 would have worked as well.

If they are equivalent, should CI be added to uninstall.sh for consistency?

MikeMcQuaid commented 1 year ago

Thanks again @osalbahr, you rock!