Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 5 commits into from
Jul 28, 2023

Conversation

osalbahr
Copy link
Contributor

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?

Adapted from `uninstall.sh`
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @osalbahr! Looking good so far.

I don't think you need to add NONINTERACTIVE or CI to uninstall.sh given that no-one has ever requested it.

install.sh Outdated Show resolved Hide resolved
install.sh Outdated Show resolved Hide resolved
install.sh Outdated Show resolved Hide resolved
install.sh Outdated Show resolved Hide resolved
@MikeMcQuaid
Copy link
Member

Thanks again @osalbahr, you rock!

@MikeMcQuaid MikeMcQuaid merged commit 5e7f306 into Homebrew:master Jul 28, 2023
3 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants