code: <howdoi> instant coding answers via the command line by Golang ❤️ is Work
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
pkg
.gitignore
.goreleaser.yml
.travis.yml
demo.png
main.go
readme.md

readme.md

howdoi Build Status

Copy from howdoi:py, But Faster

Install

go get -v -u github.com/chinanf-boy/howdoi

of cos, releases

Uasge

same as py:howdoi , but lit diff

$ howdoi -q "format date bash" -c -C

demo

TODO

  • base Feature, Get the data
  • Proxy can with Socks5
  • how many answers you want -n
  • go func with questions
  • colorful Code text with shell env -c/-T, chroma
  • cache Result -C useful refs
  • ReCache Result -R, just use GET, you still use -C if want to Cache Result
  • go func with ALL engines
  • add ChanHowdoi: got one result, show it, rather than all results
  • test file
  • Issue me anything

Notes: , cli-name Over the Python version cli

Tips

About the ENV

ENV Desc Default
HOWDOI_DISABLE_SSL change https:// => http:// nil
HOWDOI_URL search engine with the ask website stackoverflow.com
HOWDOI_URL_REGEX match the regex with URL questions/\d+/
HOWDOI_SEARCH_ENGINE search engine{bing|google} ALL
HOWDOI_CACHE_DIR http Response - Cached dir $HOME/.howdoi-cache
-T chroma theme pygments

HOWDOI_SEARCH_ENGINE, default ALL, mean GET ALL engines, but got the winner about speed.

NOTE, careful about Cache dir, you will miss the ever Data after you changed diff HOWDOI_CACHE_DIR。

Ref

chroma theme

themes >>
[
  abap, algol, algol_nu, arduino, autumn, borland, bw, colorful, dracula, emacs, friendly, fruity, github, igor, lovelace, manni, monokai, monokailight, murphy, native, paraiso-dark, paraiso-light, pastie, perldoc, pygments, rainbow_dash, rrt, solarized-dark, solarized-dark256, solarized-light, swapoff, tango, trac, vim, vsxcode
]

Cli

usage: howdoi [-h|--help] [-c|--color] [-v|--version] [-n|--num <integer>]
              -q|--query "<value>" [-q|--query "<value>" ...] [-D|--debug]
              [-T|--theme "<value>"] [-C|--cache] [-R|--recache]

              cli to Ask the question

Arguments:

  -h  --help     Print help information
  -c  --color    colorful Output. Default: false
  -v  --version  version
  -n  --num      how many answer. Default: 1
  -q  --query    query what
  -D  --debug    debug *
  -T  --theme    chrome styles. Default: pygments
  -C  --cache    cache response?. Default: false
  -R  --recache  reGET response, Cache thing have to with -C ?. Default: false

Why rewrite

  1. proxy,some issue with socks
  2. fast