注册 登录
  • 欢迎访问开心洋葱网站,在线教程,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站,欢迎加入开心洋葱 QQ群
  • 为方便开心洋葱网用户,开心洋葱官网已经开启复制功能!
  • 欢迎访问开心洋葱网站,手机也能访问哦~欢迎加入开心洋葱多维思维学习平台 QQ群
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏开心洋葱吧~~~~~~~~~~~~~!
  • 感谢各位客官的到来,小站的已经免费运营了15年头了,如果您觉着好,看着文章写的不错,还请看官给小站打个赏~~~~~~~~~~~~~!

dotnet cli 5.0 新特性——dotnet tool search

其他 WeihanLi 3041次浏览 0个评论 手机上查看

dotnet cli 5.0 新特性——dotnet tool search

Intro

.NET 5.0 SDK 的发布,给 dotnet cli 引入了一个新的特性,dotnet tool search,主要用于搜索 Nuget 上的 dotnet tool,这个命令会搜索 tool 的名称以及一些元数据, titles, descriptions, 和 tags

Search

Synopsis

dotnet tool search [–detail] [–prerelease]
[–skip ] [–take ]

dotnet tool search -h|–help

可以通过 dotnet tool search -h 查看支持的参数,支持的参数如下:

  • --detail

    显示详细结果

  • --prerelease

    是否包含预览版

  • --skip <NUMBER>

    跳过前面多少条数据,用于分页

  • --take <NUMBER>

    指定要返回的数据条数,用于分页查询

Examples

来看几个简单的示例:

使用 dotnet tool search <keyword> 进行最基本的搜索,

使用 dotnet tool search <keyword> --skip <skip> --take <take> 来进行分页查询

dotnet cli 5.0 新特性——dotnet tool search

使用 dotnet tool search <keyword> --take 1 --detail 查询详细信息

dotnet cli 5.0 新特性——dotnet tool search

More

这个功能从 .NET 5.0 SDK 之后才支持,它的实现方式倒是很简单,直接调用了 Nuget 的接口,通过 packageType=dotnettool 只查询 dotnet tool

用抓包工具抓个包看看,search 的时候做了什么,search 的时候会调用 nuget 的接口,接口调用情况如下:

dotnet cli 5.0 新特性——dotnet tool search

有了这个我们即使不完全记得 dotnet tool 的名称,我们也可以通过命令进行查询,方便了很多

References

  • https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-tool-search


开心洋葱 , 版权所有丨如未注明 , 均为原创丨未经授权请勿修改 , 转载请注明dotnet cli 5.0 新特性——dotnet tool search
喜欢 (0)
[]
分享 (0)
关于作者:

您必须 登录 才能发表评论!

加载中……