简体   繁体   English

.NET Core 6 CLI 命令中的 -o 标志是什么意思?

[英]What does the -o flag mean in the .NET Core 6 CLI command?

What is the -o flag in this .NET CLI command: do.net new webapi -o RESTfulAPIName ?这个 .NET CLI 命令中的-o标志是什么: do.net new webapi -o RESTfulAPIName

My.Net Core SDK version is 6.0.403. My.Net Core SDK 版本为 6.0.403。

It's the Output flag.这是 Output 标志。 It's used to change the location of the scaffolded files to another directory name.它用于将脚手架文件的位置更改为另一个目录名称。 By default, the code is placed in ./<ProjectName>/ .默认情况下,代码放在./<ProjectName>/中。

You can see the documentation for this flag by running do.net new --help or online .您可以通过运行do.net new --help在线查看此标志的文档。

According to Microsoft Learn , the -o flag means:根据Microsoft Learn的说法, -o标志表示:

[-o|--output <OUTPUT_DIRECTORY>] [--project <PROJECT_PATH>]

It just creates a folder and puts your created .NET project inside it with a specific name.它只是创建一个文件夹,并将您创建的 .NET 项目放入其中并具有特定名称。

See this screenshot of my terminal with and without the -o option specified below:请参阅我的终端屏幕截图,其中包含和不包含下面指定的-o选项:

终端的屏幕截图,首先指定了“-o”标志,然后不指定。

All these answers are very helpful and below is the best answer I found by @gunr2171所有这些答案都非常有帮助,下面是我找到的最佳答案 @gunr2171

It's the Output flag.这是 Output 标志。 It's used to change the location of the scaffolded files to another directory name.它用于将脚手架文件的位置更改为另一个目录名称。 By default, the code is placed in.//.默认情况下,代码放在.//。 You can see the documentation for this flag by running do.net new --help or online.您可以通过运行do.net new --help或在线查看此标志的文档。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM