dotnet cli 5.0 新特性——dotnet tool search

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 tool search <keyword> --take 1 --detail 查询详细信息

More

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

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

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

References

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值