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
More granular control over HOWDOI_SEARCH_ENGINE #235
Conversation
… be set within the howdoi process itself.
If we want to add a command line arguments, I would recommend using If we use simple |
Did it. |
This is going to need some work with the new caching code in the fastcache branch. |
I'm wrestling with adding additional command line arguments that can already be achieved with environment variables. For example consider the following:
then
is different than
Thoughts? |
You're absolutely right. With that said, environment variables ought not be the primary interface - that's just poor UX. However, bing results are so poor for howdoi's purposes that I don't think it matters - no one other than people who can't use google for some reason are likely to want to use bing. |
Yes the main reason I could see users switching away from Google is if they're blocked due to a rate limit, or if using howdoi from a country that blocks Google. I think the best thing to do would be a note on the README page that includes the following snippet
|
I'm not opposed to adding this in future, I just don't currently have the bandwidth to go through what this would do to the new caching. Probably nothing bad other than output cache not hitting, I just don't recall (several ksloc deep into a couple other projects atm). In principle, I'd like to see a better config layer that accepts a .py config file in appdirs.user_config_dir, env vars, command line arguments or py dict when howdoi is used as a library. And a man page. I'd take that over ad hoc tweaks to particular settings. Edit: this comment is not me volunteering to implement that ;) |
To be clear, I see no harm in adding this and no reason not to do it, provided it doesn't break anything. I'd say wait until dev is merged into master, rebase/eliminate merge conflicts if necessary, and wait for @rtruxal to test and confirm that it doesn't break the new caching (by break I mean errors, not misses). Being picky with relatively small patches that are clearly not net negative is not a good way to keep new contributors involved and interested imo. |
Ok I just merged dev into master. Would you please rebase @rtruxal? |
Appears to have no conflicts. @rtruxal please test that it doesn't break caching (run with HOWDOI_DISABLE_CACHE, without, on clear/full cache and so on), and address https://github.com/gleitz/howdoi/pull/235/files#r278707922 If all goes well, and by @gleitz 's assent, I think this can go in :) |
@paulie-g - Sounds good. I will try to do this over the weekend. |
@rtruxal no rush but lemme know if those checks passes and you're ready to merge. |
Gahhh thank you for the reminder. |
So good-news/bad-news: good news - I checked the new arg against the bad-news - The optional positional arg doesn't work. |
I think the correct usage should be
|
Thanks for this! |
added a bing arg to the cmdline interface so HOWDOI_SEARCH_ENGINE can be set within the howdoi process itself.