从命令行搜索Internet上的命令。
searchcmd的Python项目详细描述
- 免费软件:BSD许可证
在不离开你最好的朋友cli的情况下,从互联网上的朋友那里获得帮助。
动机
许多命令都有很多标志,手册页常常缺少示例。通常进入浏览器并搜索您想做的事情会更快。
安装
sudo apt-get install libxml2-dev libxslt-dev python-dev pip install searchcmd
示例
# searchcmd git commit "change last commit message" git commit (git-scm.com, kernel.org) git commit --amend (help.github.com) git commit –amend -m ‘new message’ (makandracards.com) git commit --amend --no-edit (kernel.org) git commit -c ORIG_HEAD (kernel.org)
# searchcmd find "sort files by size" find . -type f -printf "%s\t%p\n" | sort -n (unix.stackexchange.com) find . -type f | xargs du -h | sort -rn (unix.stackexchange.com) find . -type f -print0 | xargs -0 ls -la | awk '{print int($5/1000) " KB\t" $9}' | sort -n -r -k1 (unix.stackexchange.com) find . -type f -ls | sort -r -n -k7 (unix.stackexchange.com) find . -type f -ls -printf '\0' | sort -zk7rn | tr -d '\0' (unix.stackexchange.com)
手动
usage: searchcmd [-h] [-v] [--no-cache] [--engine {bing,google}] [-n MAX_HITS] [--max-download MAX_DOWNLOAD] query [query ...] positional arguments: query Type a command and/or describe what you want to do in quotes. optional arguments: -h, --help show this help message and exit -v, --verbose Include source url in output. --no-cache Skip cache, always do a new search. --engine {bing,google} The search engine to use. -n MAX_HITS, --max-hits MAX_HITS Max number of commands to show. --max-download MAX_DOWNLOAD Download max this number of search hits. Examples: searchcmd git commit "change last commit message" searchcmd find directory searchcmd "search replace"
待办事项
- 支持识别更高级的提示。示例:um@server\find.-姓名“*sh*”
- 执行相同操作的合并命令。
- 在PY3中支持美化组。
- 开放式搜索(例如“search replace”)将只查找安装在系统上的命令。为了允许未知命令,需要更好地过滤误报。解决方案可以是训练一个概率解析器,比如https://github.com/datamade/parserator
历史记录
0.1.0(2015-06-01)
- pypi上的第一个版本。