从命令行搜索Internet上的命令。

searchcmd的Python项目详细描述


https://img.shields.io/travis/jimmyppi/searchcmd.svghttps://img.shields.io/pypi/v/searchcmd.svg
  • 免费软件: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"

类似项目

命令行中的有用示例: https://github.com/srsudar/eg

从终端搜索commandlinefu.com: https://github.com/ncrocfer/clf

待办事项

  • 支持识别更高级的提示。示例:um@server\find.-姓名“*sh*”
  • 执行相同操作的合并命令。
  • 在PY3中支持美化组。
  • 开放式搜索(例如“search replace”)将只查找安装在系统上的命令。为了允许未知命令,需要更好地过滤误报。解决方案可以是训练一个概率解析器,比如https://github.com/datamade/parserator

历史记录

0.1.0(2015-06-01)

  • pypi上的第一个版本。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
未检测到“空格”的java ASCII码   音频如何在Java中设置SourceDataLine的音量   java MyBatissSpringBoot无法使用作为bean注入的数据源   Java字谜递归列表<List<String>>仅存储空列表<Strings>   java显示30px高的JPanel,然后用minecraft填充剩余空间   java JOGL平滑度   Java:按完整与否对1d对象数组进行排序   arraylist仅当java结构不存在时才将对象添加到java结构中   无法初始化java渲染库在安卓 studio 4.1.1上出现错误   java SpringBoot ClassCastException   java解析文本文件,基于字数   java=运算符引发异常   java使点可拖动并存储新坐标JavaFx   JavaWebSphereApplicationServer:EJB模块和JMS路由器