Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -61,6 +60,9 @@ internal static class ListPackageReferencesCommandParser
ArgumentHelpName = CommonLocalizableStrings.LevelArgumentName
}.ForwardAsSingle(o => $"--verbosity:{o}");

public static readonly Option FormatOption = new ForwardedOption<ReportOutputFormat>("--format", LocalizableStrings.CmdFormatDescription)
{ }.ForwardAsSingle(o => $"--format:{o}");

private static readonly Command Command = ConstructCommand();

public static Command GetCommand()
Expand All @@ -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());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,7 @@
<data name="CmdVulnerableDescription" xml:space="preserve">
<value>Lists packages that have known vulnerabilities. Cannot be combined with '--deprecated' or '--outdated' options.</value>
</data>
</root>
<data name="CmdFormatDescription" xml:space="preserve">
<value>Specifies the output format type for the list packages command.</value>
</data>
</root>
Original file line number Diff line number Diff line change
@@ -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
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
<target state="translated">Vypíše balíčky, které jsou zastaralé. Nedá se kombinovat s možností --vulnerable ani --outdated.</target>
<note />
</trans-unit>
<trans-unit id="CmdFormatDescription">
<source>Specifies the output format type for the list packages command.</source>
<target state="new">Specifies the output format type for the list packages command.</target>
<note />
</trans-unit>
<trans-unit id="CmdFramework">
<source>FRAMEWORK | FRAMEWORK\RID</source>
<target state="translated">FRAMEWORK | FRAMEWORK\RID</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
<target state="translated">Listet Pakete auf, die veraltet sind. Kann nicht mit den Optionen "--vulnerable" oder "--outdated" kombiniert werden.</target>
<note />
</trans-unit>
<trans-unit id="CmdFormatDescription">
<source>Specifies the output format type for the list packages command.</source>
<target state="new">Specifies the output format type for the list packages command.</target>
<note />
</trans-unit>
<trans-unit id="CmdFramework">
<source>FRAMEWORK | FRAMEWORK\RID</source>
<target state="translated">FRAMEWORK | FRAMEWORK\RID</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
<target state="translated">Muestra los paquetes que han quedado en desuso. No se puede combinar con las opciones "--outdated" o "--vulnerable".</target>
<note />
</trans-unit>
<trans-unit id="CmdFormatDescription">
<source>Specifies the output format type for the list packages command.</source>
<target state="new">Specifies the output format type for the list packages command.</target>
<note />
</trans-unit>
<trans-unit id="CmdFramework">
<source>FRAMEWORK | FRAMEWORK\RID</source>
<target state="translated">FRAMEWORK | FRAMEWORK\RID</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
<target state="translated">Liste les packages qui ont été dépréciés. Impossible à combiner avec les options '--vulnerable' ou '--outdated'.</target>
<note />
</trans-unit>
<trans-unit id="CmdFormatDescription">
<source>Specifies the output format type for the list packages command.</source>
<target state="new">Specifies the output format type for the list packages command.</target>
<note />
</trans-unit>
<trans-unit id="CmdFramework">
<source>FRAMEWORK | FRAMEWORK\RID</source>
<target state="translated">FRAMEWORK | FRAMEWORK\RID</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
<target state="translated">Elenca i pacchetti che sono stati deprecati. Non può essere combinato con l'opzione '--vulnerable' o '--outdated'.</target>
<note />
</trans-unit>
<trans-unit id="CmdFormatDescription">
<source>Specifies the output format type for the list packages command.</source>
<target state="new">Specifies the output format type for the list packages command.</target>
<note />
</trans-unit>
<trans-unit id="CmdFramework">
<source>FRAMEWORK | FRAMEWORK\RID</source>
<target state="translated">FRAMEWORK | FRAMEWORK\RID</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
<target state="translated">非推奨化されたパッケージを一覧表示します。'--vulnerable' または '--outdated' オプションと組み合わせることはできません。</target>
<note />
</trans-unit>
<trans-unit id="CmdFormatDescription">
<source>Specifies the output format type for the list packages command.</source>
<target state="new">Specifies the output format type for the list packages command.</target>
<note />
</trans-unit>
<trans-unit id="CmdFramework">
<source>FRAMEWORK | FRAMEWORK\RID</source>
<target state="translated">FRAMEWORK | FRAMEWORK\RID</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
<target state="translated">사용되지 않는 패키지를 나열합니다. '--vulnerable' 또는 '--outdated' 옵션과 함께 사용할 수 없습니다.</target>
<note />
</trans-unit>
<trans-unit id="CmdFormatDescription">
<source>Specifies the output format type for the list packages command.</source>
<target state="new">Specifies the output format type for the list packages command.</target>
<note />
</trans-unit>
<trans-unit id="CmdFramework">
<source>FRAMEWORK | FRAMEWORK\RID</source>
<target state="translated">FRAMEWORK | FRAMEWORK\RID</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
<target state="translated">Wyświetla pakiety, które są przestarzałe. Nie można łączyć z opcją „--vulnerable” ani „--outdated”.</target>
<note />
</trans-unit>
<trans-unit id="CmdFormatDescription">
<source>Specifies the output format type for the list packages command.</source>
<target state="new">Specifies the output format type for the list packages command.</target>
<note />
</trans-unit>
<trans-unit id="CmdFramework">
<source>FRAMEWORK | FRAMEWORK\RID</source>
<target state="translated">FRAMEWORK | FRAMEWORK\RID</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
<target state="translated">Lista os pacotes que foram preteridos. Não pode ser combinado com a opção '--vulnerable' nem com a opção '--outdated'.</target>
<note />
</trans-unit>
<trans-unit id="CmdFormatDescription">
<source>Specifies the output format type for the list packages command.</source>
<target state="new">Specifies the output format type for the list packages command.</target>
<note />
</trans-unit>
<trans-unit id="CmdFramework">
<source>FRAMEWORK | FRAMEWORK\RID</source>
<target state="translated">FRAMEWORK | FRAMEWORK\RID</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
<target state="translated">Возвращает список устаревших пакетов. Не может использоваться с параметрами "--vulnerable" или "--outdated".</target>
<note />
</trans-unit>
<trans-unit id="CmdFormatDescription">
<source>Specifies the output format type for the list packages command.</source>
<target state="new">Specifies the output format type for the list packages command.</target>
<note />
</trans-unit>
<trans-unit id="CmdFramework">
<source>FRAMEWORK | FRAMEWORK\RID</source>
<target state="translated">FRAMEWORK | FRAMEWORK\RID</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
<target state="translated">Kullanım dışı bırakılan paketleri listeler. '--vulnerable' veya '--outdated' seçenekleriyle birleştirilemez.</target>
<note />
</trans-unit>
<trans-unit id="CmdFormatDescription">
<source>Specifies the output format type for the list packages command.</source>
<target state="new">Specifies the output format type for the list packages command.</target>
<note />
</trans-unit>
<trans-unit id="CmdFramework">
<source>FRAMEWORK | FRAMEWORK\RID</source>
<target state="translated">FRAMEWORK | FRAMEWORK\RID</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
<target state="translated">列出已被弃用的包。不能与 "--vulnerable" 或 "--outdated" 选项结合使用。</target>
<note />
</trans-unit>
<trans-unit id="CmdFormatDescription">
<source>Specifies the output format type for the list packages command.</source>
<target state="new">Specifies the output format type for the list packages command.</target>
<note />
</trans-unit>
<trans-unit id="CmdFramework">
<source>FRAMEWORK | FRAMEWORK\RID</source>
<target state="translated">FRAMEWORK | FRAMEWORK\RID</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
<target state="translated">列出已淘汰的套件。無法與 '--vulnerable' 或 '--outdated' 選項一併使用。</target>
<note />
</trans-unit>
<trans-unit id="CmdFormatDescription">
<source>Specifies the output format type for the list packages command.</source>
<target state="new">Specifies the output format type for the list packages command.</target>
<note />
</trans-unit>
<trans-unit id="CmdFramework">
<source>FRAMEWORK | FRAMEWORK\RID</source>
<target state="translated">FRAMEWORK | FRAMEWORK\RID</target>
Expand Down