jrkong / pySearch

Simple command line python script that opens a new browser tab to search the input string
BSD 3-Clause "New" or "Revised" License
4 stars 5 forks source link

Added -b or --browser parameter #17

Open JoshuaRM opened 5 years ago

JoshuaRM commented 5 years ago

Solves #14 Added a -b parameter that allows the user to specify which browser to open in. If an invalid or unregistered browser is entered, an error is shown and the available list of browsers is displayed

JoshuaRM commented 5 years ago

Updated the browser parameter to a safer state. The parameter has been created to work with chrome, firefox, internet explorer, and safari, and has been tested on both Mac OS and Windows.

The parameter uses regular expression and accepts any of the following terms, all case insensitive: To open in chrome google, chrome, google chrome, google-chrome To open in firefox firefox, mozilla-firefox, mozilla, mozilla firefox To open in internet explorer ie, internet-explorer, internet explorer, iexplore, iexplorer To open in safari safari

The script currently works assuming web browsers are registered as their executable file name (chrome, firefox, safari, iexplore)

jrkong commented 5 years ago

I think we can add a disclaimer for the -b command line argument stating that it requires the browser path to be in the user's PATH to work properly on Windows.

Could you add the command line argument to the README and add a statement or warning regarding Windows functionality?

pep8speaks commented 5 years ago

Hello @JoshuaRM! Thanks for updating the PR.

JoshuaRM commented 5 years ago

In this commit I changed the flake8 ignore list to add the flake8 error it gives now. The binary operator needs to be on separate lines, and flake8 does not like that.