Git Product home page Git Product logo

Comments (6)

felixonmars avatar felixonmars commented on August 12, 2024

I don't use zsh myself, but I'm open to a PR for this :)

from ydcv.

Firef0x avatar Firef0x commented on August 12, 2024

好吧,我尽量试试。抱歉刚才在抢红包回复晚了。

from ydcv.

Firef0x avatar Firef0x commented on August 12, 2024

不小心用了中文回复了。⊙﹏⊙b 那就一直用中文吧:

  • 列出所有参数项
  -h, --help            show this help message and exit
  -f, --full            print full web reference, only the first 3 results
                        will be printed without this flag.
  -s, --simple          only show explainations. argument "-f" will not take
                        effect
  -x, --selection       show explaination of current selection.
  --color {always,auto,never}
                        colorize the output. Default to 'auto' or can be
                        'never' or 'always'.
  • 列出 --color 的所有可选参数
  • 列出 -x 的当前选择文字(放弃)
  • 根据输入列出搜索建议(依赖 #23

个人列出这些用户需求,请审阅。

from ydcv.

felixonmars avatar felixonmars commented on August 12, 2024

看起来不错. 不过 "列出 -x 的当前选择文字" 会不会让人误以为需要把当前选择文字作为参数? (抱歉我不太了解 zsh...)

from ydcv.

Firef0x avatar Firef0x commented on August 12, 2024

“列出搜索建议”这一项需要 ydcv 提供一个参数,当增加了这个参数后, ydcv 把搜索建议以以下方式输出。(假设该参数名为 --list-suggestions ,以 aard 为例)

$ ydcv --list-suggestions aard

aard
aardman
aardman animations
aardvark
aardwolf

但是我不清楚怎么样调用有道翻译的搜索建议 API …… 😕 😖

以下数据提取自 http://dsuggest.ydstatic.com/suggest/suggest.s?query=aard&o=aa&keyfrom=dict.suggest

 <div style="display:none" id="aard"></div>
  <div>
   <table cellpadding="0" cellspacing="1" border="0" width="100%" bgcolor="#979797" align="center">
    <tbody>
     <tr>
      <td valign="top">
       <table cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
        <tbody>
         <tr onselect="this.txtBox.value=aard">
          <td align="left" bgcolor="white" class="remindtt75">aard</td>
         </tr>
         <tr onselect="this.txtBox.value=aardvark">
          <td align="left" bgcolor="white" class="remindtt75" colspan="2">aardvark</td>
         </tr>
         <tr onselect="this.txtBox.value=aardwolf">
          <td align="left" bgcolor="white" class="remindtt75" colspan="2">aardwolf</td>
         </tr>
         <tr onselect="this.txtBox.value=aardman">
          <td align="left" bgcolor="white" class="remindtt75" colspan="2">aardman</td>
         </tr>
         <tr onselect="this.txtBox.value=aardman animations">
          <td align="left" bgcolor="white" class="remindtt75" colspan="2">aardman animations</td>
         </tr>
        </tbody>
       </table>
       <table cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
        <tbody>
         <tr>
          <td height="1px" bgcolor="#DDDDDD"></td>
         </tr>
         <tr>
          <td align="right" height="17px" bgcolor="#ECF0EF" class="jstxhuitiaoyou"><a class="jstxlan" onclick="turnOffSuggest();">关闭提示功能</a></td>
         </tr>
        </tbody>
       </table></td>
     </tr>
    </tbody>
   </table>
  </div> 

from ydcv.

Firef0x avatar Firef0x commented on August 12, 2024

更新一下

“根据输入列出搜索建议”这项用户需求依赖 #23 ,我想以我的能力目前还做不出来。并且考虑到如果需要不断发送网络请求的话可能会有性能问题。所以暂时搁置这项用户需求了。

这样就只剩下前面两项用户需求了,基本在 #22 中实现了。我个人测试使用了近一个月(通过安装 ydcv-git-0.3.6.20150307.cd10332-1-any.pkg.tar ),没有发现有什么问题。 @felixonmars 大神如果有什么问题的话可以提出。

期待能够合并到主仓库中。

from ydcv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.