enforce code style with Boolean

This commit is contained in:
Syping 2025-11-23 06:22:48 +01:00
parent c131a7532e
commit 4cc95309a2
3 changed files with 8 additions and 8 deletions

View file

@ -53,8 +53,8 @@ internal static partial class Commands {
Description = "Path Command" Description = "Path Command"
}; };
commandArgument.CompletionSources.Add(_ => [ commandArgument.CompletionSources.Add(_ => [
new ("register"), new("register"),
new ("unregister")]); new("unregister")]);
commandArgument.Validators.Add(result => { commandArgument.Validators.Add(result => {
String[] commands = ["register", "unregister"]; String[] commands = ["register", "unregister"];
String command = result.GetValueOrDefault<String>(); String command = result.GetValueOrDefault<String>();

View file

@ -6,7 +6,7 @@ namespace RagePhoto.Cli;
internal static partial class Commands { internal static partial class Commands {
internal static Int32 CreateFunction(String format, String? imageFile, String? description, internal static Int32 CreateFunction(String format, String? imageFile, String? description,
String? json, String? title, String? outputFile, bool imageAsIs) { String? json, String? title, String? outputFile, Boolean imageAsIs) {
try { try {
using Photo photo = new(); using Photo photo = new();
@ -159,7 +159,7 @@ internal static partial class Commands {
} }
internal static Int32 SetFunction(String inputFile, String? format, String? imageFile, String? description, internal static Int32 SetFunction(String inputFile, String? format, String? imageFile, String? description,
String? json, String? title, bool updateJson, String? outputFile, bool imageAsIs) { String? json, String? title, Boolean updateJson, String? outputFile, Boolean imageAsIs) {
try { try {
if (format == null && imageFile == null && description == null if (format == null && imageFile == null && description == null
&& json == null && title == null && !updateJson) { && json == null && title == null && !updateJson) {
@ -273,7 +273,7 @@ internal static partial class Commands {
Option<String?> outputOption = new("--output", "-o") { Option<String?> outputOption = new("--output", "-o") {
Description = "Output File" Description = "Output File"
}; };
Option<bool> imageAsIsOption = new("--image-as-is") { Option<Boolean> imageAsIsOption = new("--image-as-is") {
Description = "Force image being set as-is" Description = "Force image being set as-is"
}; };
Command createCommand = new("create", "Create a new Photo") { Command createCommand = new("create", "Create a new Photo") {
@ -362,13 +362,13 @@ internal static partial class Commands {
Option<String?> titleOption = new("--title", "-t") { Option<String?> titleOption = new("--title", "-t") {
Description = "Title" Description = "Title"
}; };
Option<bool> updateJsonOption = new("--update-json", "-u") { Option<Boolean> updateJsonOption = new("--update-json", "-u") {
Description = "Update JSON" Description = "Update JSON"
}; };
Option<String?> outputOption = new("--output", "-o") { Option<String?> outputOption = new("--output", "-o") {
Description = "Output File" Description = "Output File"
}; };
Option<bool> imageAsIsOption = new("--image-as-is") { Option<Boolean> imageAsIsOption = new("--image-as-is") {
Description = "Force image being set as-is" Description = "Force image being set as-is"
}; };
Command setCommand = new("set", "Set Data from a Photo") { Command setCommand = new("set", "Set Data from a Photo") {

View file

@ -29,7 +29,7 @@ internal class Jpeg {
return jpegStream.ToArray(); return jpegStream.ToArray();
} }
internal static Byte[] GetJpeg(Stream input, bool imageAsIs, out Size size) { internal static Byte[] GetJpeg(Stream input, Boolean imageAsIs, out Size size) {
try { try {
if (imageAsIs) { if (imageAsIs) {
using MemoryStream jpegStream = new(); using MemoryStream jpegStream = new();