From 9d9cfaa88217c801f67824bd8335d0df6c6bf135 Mon Sep 17 00:00:00 2001 From: Syping Date: Mon, 27 Oct 2025 04:24:49 +0100 Subject: [PATCH] impl. update-sign option for set command --- Program.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Program.cs b/Program.cs index 1aa8329..e096697 100644 --- a/Program.cs +++ b/Program.cs @@ -147,7 +147,7 @@ internal static class Program { } } - private static void Set(FileInfo photoFile, String? format, String? jpegFile, String? description, String? json, String? title, String? outputFile) { + private static void Set(FileInfo photoFile, String? format, String? jpegFile, String? description, String? json, String? title, bool updateSign, String? outputFile) { if (format == null && jpegFile == null && description == null && json == null && title == null) { Console.Error.WriteLine("No value has being set"); @@ -186,6 +186,9 @@ internal static class Program { photo.Jpeg = jpegStream.ToArray(); photo.Json = UpdateSign(photo, photo.Json); } + else if (updateSign) { + photo.Json = UpdateSign(photo, photo.Json); + } if (outputFile == "-") { using MemoryStream photoStream = new(photo.Save()); @@ -387,6 +390,9 @@ internal static class Program { Option titleOption = new("--title", "-t") { Description = "Photo Title" }; + Option updateSignOption = new("--update-sign", "-u") { + Description = "Update Photo Signature" + }; Option outputOption = new("--output", "-o") { Description = "Output File" }; @@ -400,6 +406,7 @@ internal static class Program { result.GetValue(descriptionOption), result.GetValue(jsonOption), result.GetValue(titleOption), + result.GetValue(updateSignOption), result.GetValue(outputOption))); return setCommand; }