diff --git a/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/ListPackageReferencesCommandParser.cs b/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/ListPackageReferencesCommandParser.cs index b79fbf9941df..3659f85b0db5 100644 --- a/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/ListPackageReferencesCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/ListPackageReferencesCommandParser.cs @@ -1,10 +1,9 @@ // Copyright (c) .NET Foundation and contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +using System; using System.Collections.Generic; using System.CommandLine; -using System.CommandLine.Invocation; -using System.CommandLine.Parsing; using Microsoft.DotNet.Tools; using Microsoft.DotNet.Tools.List.PackageReferences; using LocalizableStrings = Microsoft.DotNet.Tools.List.PackageReferences.LocalizableStrings; @@ -61,6 +60,9 @@ internal static class ListPackageReferencesCommandParser ArgumentHelpName = CommonLocalizableStrings.LevelArgumentName }.ForwardAsSingle(o => $"--verbosity:{o}"); + public static readonly Option FormatOption = new ForwardedOption("--format", LocalizableStrings.CmdFormatDescription) + { }.ForwardAsSingle(o => $"--format:{o}"); + private static readonly Command Command = ConstructCommand(); public static Command GetCommand() @@ -84,6 +86,7 @@ private static Command ConstructCommand() command.AddOption(ConfigOption); command.AddOption(SourceOption); command.AddOption(InteractiveOption); + command.AddOption(FormatOption); command.SetHandler((parseResult) => new ListPackageReferencesCommand(parseResult).Execute()); diff --git a/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/LocalizableStrings.resx b/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/LocalizableStrings.resx index 251d3430b9f7..93e0d6224b2e 100644 --- a/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/LocalizableStrings.resx +++ b/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/LocalizableStrings.resx @@ -168,4 +168,7 @@ Lists packages that have known vulnerabilities. Cannot be combined with '--deprecated' or '--outdated' options. - + + Specifies the output format type for the list packages command. + + \ No newline at end of file diff --git a/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/ReportOutputFormat.cs b/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/ReportOutputFormat.cs new file mode 100644 index 000000000000..138252a3eaec --- /dev/null +++ b/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/ReportOutputFormat.cs @@ -0,0 +1,11 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Microsoft.DotNet.Cli +{ + internal enum ReportOutputFormat + { + console = 0, + json = 1 + } +} diff --git a/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.cs.xlf b/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.cs.xlf index 4af9278800a6..bf0d79c067f2 100644 --- a/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.cs.xlf +++ b/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.cs.xlf @@ -12,6 +12,11 @@ Vypíše balíčky, které jsou zastaralé. Nedá se kombinovat s možností --vulnerable ani --outdated. + + Specifies the output format type for the list packages command. + Specifies the output format type for the list packages command. + + FRAMEWORK | FRAMEWORK\RID FRAMEWORK | FRAMEWORK\RID diff --git a/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.de.xlf b/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.de.xlf index 7e0148022346..7dfe774ae7cb 100644 --- a/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.de.xlf +++ b/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.de.xlf @@ -12,6 +12,11 @@ Listet Pakete auf, die veraltet sind. Kann nicht mit den Optionen "--vulnerable" oder "--outdated" kombiniert werden. + + Specifies the output format type for the list packages command. + Specifies the output format type for the list packages command. + + FRAMEWORK | FRAMEWORK\RID FRAMEWORK | FRAMEWORK\RID diff --git a/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.es.xlf b/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.es.xlf index 350bf8d1c1e0..346843860d4b 100644 --- a/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.es.xlf +++ b/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.es.xlf @@ -12,6 +12,11 @@ Muestra los paquetes que han quedado en desuso. No se puede combinar con las opciones "--outdated" o "--vulnerable". + + Specifies the output format type for the list packages command. + Specifies the output format type for the list packages command. + + FRAMEWORK | FRAMEWORK\RID FRAMEWORK | FRAMEWORK\RID diff --git a/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.fr.xlf b/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.fr.xlf index b715f3a046ad..489ed361570a 100644 --- a/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.fr.xlf +++ b/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.fr.xlf @@ -12,6 +12,11 @@ Liste les packages qui ont été dépréciés. Impossible à combiner avec les options '--vulnerable' ou '--outdated'. + + Specifies the output format type for the list packages command. + Specifies the output format type for the list packages command. + + FRAMEWORK | FRAMEWORK\RID FRAMEWORK | FRAMEWORK\RID diff --git a/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.it.xlf b/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.it.xlf index ed1320b58938..5ffb32d36fb0 100644 --- a/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.it.xlf +++ b/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.it.xlf @@ -12,6 +12,11 @@ Elenca i pacchetti che sono stati deprecati. Non può essere combinato con l'opzione '--vulnerable' o '--outdated'. + + Specifies the output format type for the list packages command. + Specifies the output format type for the list packages command. + + FRAMEWORK | FRAMEWORK\RID FRAMEWORK | FRAMEWORK\RID diff --git a/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.ja.xlf b/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.ja.xlf index 34902228bb99..182362d95f84 100644 --- a/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.ja.xlf +++ b/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.ja.xlf @@ -12,6 +12,11 @@ 非推奨化されたパッケージを一覧表示します。'--vulnerable' または '--outdated' オプションと組み合わせることはできません。 + + Specifies the output format type for the list packages command. + Specifies the output format type for the list packages command. + + FRAMEWORK | FRAMEWORK\RID FRAMEWORK | FRAMEWORK\RID diff --git a/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.ko.xlf b/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.ko.xlf index 3f0cf2d88ff4..94b652f59880 100644 --- a/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.ko.xlf +++ b/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.ko.xlf @@ -12,6 +12,11 @@ 사용되지 않는 패키지를 나열합니다. '--vulnerable' 또는 '--outdated' 옵션과 함께 사용할 수 없습니다. + + Specifies the output format type for the list packages command. + Specifies the output format type for the list packages command. + + FRAMEWORK | FRAMEWORK\RID FRAMEWORK | FRAMEWORK\RID diff --git a/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.pl.xlf b/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.pl.xlf index d34c9eba780a..c4fdf4a6c726 100644 --- a/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.pl.xlf +++ b/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.pl.xlf @@ -12,6 +12,11 @@ Wyświetla pakiety, które są przestarzałe. Nie można łączyć z opcją „--vulnerable” ani „--outdated”. + + Specifies the output format type for the list packages command. + Specifies the output format type for the list packages command. + + FRAMEWORK | FRAMEWORK\RID FRAMEWORK | FRAMEWORK\RID diff --git a/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.pt-BR.xlf b/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.pt-BR.xlf index b09e9cb1e8e0..455995367633 100644 --- a/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.pt-BR.xlf @@ -12,6 +12,11 @@ Lista os pacotes que foram preteridos. Não pode ser combinado com a opção '--vulnerable' nem com a opção '--outdated'. + + Specifies the output format type for the list packages command. + Specifies the output format type for the list packages command. + + FRAMEWORK | FRAMEWORK\RID FRAMEWORK | FRAMEWORK\RID diff --git a/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.ru.xlf b/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.ru.xlf index 2388edb5fb29..9a60981c49e6 100644 --- a/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.ru.xlf +++ b/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.ru.xlf @@ -12,6 +12,11 @@ Возвращает список устаревших пакетов. Не может использоваться с параметрами "--vulnerable" или "--outdated". + + Specifies the output format type for the list packages command. + Specifies the output format type for the list packages command. + + FRAMEWORK | FRAMEWORK\RID FRAMEWORK | FRAMEWORK\RID diff --git a/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.tr.xlf b/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.tr.xlf index 362f091e50c8..ca7e9232baa2 100644 --- a/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.tr.xlf +++ b/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.tr.xlf @@ -12,6 +12,11 @@ Kullanım dışı bırakılan paketleri listeler. '--vulnerable' veya '--outdated' seçenekleriyle birleştirilemez. + + Specifies the output format type for the list packages command. + Specifies the output format type for the list packages command. + + FRAMEWORK | FRAMEWORK\RID FRAMEWORK | FRAMEWORK\RID diff --git a/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.zh-Hans.xlf b/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.zh-Hans.xlf index b8d08f896736..a0e6176f5497 100644 --- a/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.zh-Hans.xlf @@ -12,6 +12,11 @@ 列出已被弃用的包。不能与 "--vulnerable" 或 "--outdated" 选项结合使用。 + + Specifies the output format type for the list packages command. + Specifies the output format type for the list packages command. + + FRAMEWORK | FRAMEWORK\RID FRAMEWORK | FRAMEWORK\RID diff --git a/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.zh-Hant.xlf b/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.zh-Hant.xlf index 2c292bed1aa9..dd90672e66c9 100644 --- a/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/Cli/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.zh-Hant.xlf @@ -12,6 +12,11 @@ 列出已淘汰的套件。無法與 '--vulnerable' 或 '--outdated' 選項一併使用。 + + Specifies the output format type for the list packages command. + Specifies the output format type for the list packages command. + + FRAMEWORK | FRAMEWORK\RID FRAMEWORK | FRAMEWORK\RID