Skip to content

Commit

Permalink
Standardize output across commands
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianstevens committed Jun 16, 2024
1 parent f1b9a21 commit 5464e5a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private void OnFileWriteProgress(object? sender, (string fileName, long complete
if (!double.IsNaN(p))
{
// Console instead of Logger due to line breaking for progress bar
Console?.Output.Write($"Writing {e.fileName}: {p:0}% \r");
Console?.Output.Write($"Writing '{e.fileName}': {p:0}% \r");
}
}
}
2 changes: 1 addition & 1 deletion Source/v2/Meadow.Cli/Commands/Current/App/AppRunCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ private void OnFileWriteProgress(object? sender, (string fileName, long complete

if (!double.IsNaN(p))
{ // Console instead of Logger due to line breaking for progress bar
Console?.Output.Write($"Writing {e.fileName}: {p:0}% \r");
Console?.Output.Write($"Writing '{e.fileName}': {p:0}% \r");
}
}

Expand Down
11 changes: 9 additions & 2 deletions Source/v2/Meadow.Cli/Commands/Current/File/FileDeleteCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,14 @@ protected override async ValueTask ExecuteCommand()
await device.RuntimeDisable(CancellationToken);
}

Logger?.LogInformation($"Looking for file {MeadowFile}...");
if (MeadowFile == "all")
{
Logger?.LogInformation($"Looking for files...");
}
else
{
Logger?.LogInformation($"Looking for file {MeadowFile}...");
}

var folder = AppTools.SanitizeMeadowFolderName(Path.GetDirectoryName(MeadowFile)!);

Expand Down Expand Up @@ -60,7 +67,7 @@ protected override async ValueTask ExecuteCommand()
}
else
{
Logger?.LogInformation($"Deleting file '{file}' from device...");
Logger?.LogInformation($"Deleting '{file}'");
await device.DeleteFile(file, CancellationToken);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected override async ValueTask ExecuteCommand()
if (!double.IsNaN(p))
{
// Console instead of Logger due to line breaking for progress bar
Console?.Output.Write($"Writing {e.fileName}: {p:0}% \r");
Console?.Output.Write($"Writing '{e.fileName}': {p:0}% \r");
}
};

Expand Down

0 comments on commit 5464e5a

Please sign in to comment.