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

Fix for pihole -w --nuke displaying help info even if command is exec… #3349

Merged
merged 1 commit into from
Nov 8, 2020

Conversation

Forceflow
Copy link
Contributor

@Forceflow Forceflow commented May 12, 2020

By submitting this pull request, I confirm the following:
please fill any appropriate checkboxes, e.g: [X]

  • I have read and understood the contributors guide, as well as this entire template.
  • I have made only one major change in my proposed changes.
  • I have commented my proposed changes within the code.
  • I have tested my proposed changes, and have included unit tests where possible.
  • I am willing to help maintain this change if there are issues with it later.
  • I give this submission freely and claim no ownership.
  • It is compatible with the EUPL 1.2 license
  • I have squashed any insignificant commits. (git rebase)

What does this PR aim to accomplish?:
In the latest release version (5.0), doing a pihole -w --nuke to nuke the whitelist works, but the standard syntax help information was still displayed (the output you get when you do pihole -w --help).

This gives the user the impression that the syntax was wrong and the nuke did not go through. This could be confusing.

example:

pi@pihole:~ $ pihole -w --nuke
Usage: pihole -w [options] <domain> <domain2 ...>
Example: 'pihole -w site.com', or 'pihole -w site1.com site2.com'
Whitelist one or more domains

Options:
  -d, --delmode       Remove domain(s) from the whitelist
  -nr, --noreload     Update whitelist without reloading the DNS server
  -q, --quiet         Make output less verbose
  -h, --help          Show this help dialog
  -l, --list          Display all your whitelistlisted domains
  --nuke              Removes all entries in a list

This PR rectifies this behaviour

How does this PR accomplish the above?:
By making sure the call to NukeList() exits, like any other function in the same module. (For example, Displaylist() )

Possible additional improvement is to output the exit code of the sqlite3 command, but that's not done in other functions here, so I left that out.

What documentation changes (if any) are needed to support this PR?:
None.

…uted correctly

Signed-off-by: Jeroen Baert <3607063+Forceflow@users.noreply.github.com>
@Forceflow
Copy link
Contributor Author

Forceflow commented May 13, 2020

Seeing same behaviour in pihole --white-regex and --white-wild. Might ammend this commit tomorrow.

edit: Disgregard that, this fix applies for that as well.

@PromoFaux PromoFaux merged commit 4abd819 into pi-hole:development Nov 8, 2020
@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/pi-hole-core-web-v5-2-and-ftl-v5-3-released/40909/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants