impl. completion sources for get dataType

This commit is contained in:
Syping 2025-10-25 02:43:26 +02:00
parent 09bf4b4034
commit 84c371dede

View file

@ -1,4 +1,5 @@
using System.CommandLine; using System.CommandLine;
using System.CommandLine.Completions;
using System.Text; using System.Text;
namespace RagePhoto.Cli; namespace RagePhoto.Cli;
@ -149,6 +150,17 @@ internal static class Program {
Description = "Data Type", Description = "Data Type",
DefaultValueFactory = _ => "jpeg" DefaultValueFactory = _ => "jpeg"
}; };
dataTypeArgument.CompletionSources.Add(_ => {
List<CompletionItem> dataTypes = [];
dataTypes.AddRange([
new("description"),
new("format"),
new("jpeg"),
new("json"),
new("sign"),
new("title")]);
return dataTypes;
});
Option<String> outputOption = new("--output", "-o") { Option<String> outputOption = new("--output", "-o") {
Description = "Output File", Description = "Output File",
DefaultValueFactory = _ => "-" DefaultValueFactory = _ => "-"