/
githubmirror
/
PowerToys
Обзор
Документация
Войти
/
githubmirror
/
PowerToys
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/modules/imageresizer/ui/Cli/Commands/ImageResizerRootCommand.cs
90 строк
3 KB
leileizhang
Add standard CLI support for Image Resizer (#44287)
26 дек 2025, 07:54
Не верифицирован
26 дек 2025, 07:54
673cd5a
Код
Авторство
О чём код?
// Copyright (c) Microsoft Corporation // The Microsoft Corporation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.CommandLine; using ImageResizer.Cli.Options; namespace ImageResizer.Cli.Commands { /// <summary> /// Root command for the ImageResizer CLI. /// </summary> public sealed class ImageResizerRootCommand : RootCommand { public ImageResizerRootCommand() : base("PowerToys Image Resizer - Resize images from command line") { HelpOption = new HelpOption(); ShowConfigOption = new ShowConfigOption(); DestinationOption = new DestinationOption(); WidthOption = new WidthOption(); HeightOption = new HeightOption(); UnitOption = new UnitOption(); FitOption = new FitOption(); SizeOption = new SizeOption(); ShrinkOnlyOption = new ShrinkOnlyOption(); ReplaceOption = new ReplaceOption(); IgnoreOrientationOption = new IgnoreOrientationOption(); RemoveMetadataOption = new RemoveMetadataOption(); QualityOption = new QualityOption(); KeepDateModifiedOption = new KeepDateModifiedOption(); FileNameOption = new FileNameOption(); ProgressLinesOption = new ProgressLinesOption(); FilesArgument = new FilesArgument(); AddOption(HelpOption); AddOption(ShowConfigOption); AddOption(DestinationOption); AddOption(WidthOption); AddOption(HeightOption); AddOption(UnitOption); AddOption(FitOption); AddOption(SizeOption); AddOption(ShrinkOnlyOption); AddOption(ReplaceOption); AddOption(IgnoreOrientationOption); AddOption(RemoveMetadataOption); AddOption(QualityOption); AddOption(KeepDateModifiedOption); AddOption(FileNameOption); AddOption(ProgressLinesOption); AddArgument(FilesArgument); } public HelpOption HelpOption { get; } public ShowConfigOption ShowConfigOption { get; } public DestinationOption DestinationOption { get; } public WidthOption WidthOption { get; } public HeightOption HeightOption { get; } public UnitOption UnitOption { get; } public FitOption FitOption { get; } public SizeOption SizeOption { get; } public ShrinkOnlyOption ShrinkOnlyOption { get; } public ReplaceOption ReplaceOption { get; } public IgnoreOrientationOption IgnoreOrientationOption { get; } public RemoveMetadataOption RemoveMetadataOption { get; } public QualityOption QualityOption { get; } public KeepDateModifiedOption KeepDateModifiedOption { get; } public FileNameOption FileNameOption { get; } public ProgressLinesOption ProgressLinesOption { get; } public FilesArgument FilesArgument { get; } } }