diff --git a/src/Commands/CostSettings.cs b/src/Commands/CostSettings.cs index bdd350e..f9ead47 100644 --- a/src/Commands/CostSettings.cs +++ b/src/Commands/CostSettings.cs @@ -31,6 +31,6 @@ public class CostSettings : LogCommandSettings public int OthersCutoff { get; set; } = 10; [CommandOption("--query")] - [Description("JMESPath query string. See http://jmespath.org/ for more information and examples.")] + [Description("JMESPath query string, applicable for the Json output only. See http://jmespath.org/ for more information and examples.")] public string Query { get; set; } = string.Empty; } \ No newline at end of file diff --git a/src/OutputFormatters/MarkdownOutputFormatter.cs b/src/OutputFormatters/MarkdownOutputFormatter.cs index d339249..fb49f63 100644 --- a/src/OutputFormatters/MarkdownOutputFormatter.cs +++ b/src/OutputFormatters/MarkdownOutputFormatter.cs @@ -89,7 +89,8 @@ public override Task WriteAccumulatedCost(AccumulatedCostSettings settings,Accum Console.WriteLine(" title Cost by service"); foreach (var cost in accumulatedCostDetails.ByServiceNameCosts.TrimList(threshold: settings.OthersCutoff)) { - Console.WriteLine($" \"{cost.ItemName}\" : {cost.Cost.ToString("F2", culture)}"); + var name = string.IsNullOrWhiteSpace(cost.ItemName) ? "(Unknown)" : cost.ItemName; + Console.WriteLine($" \"{name}\" : {cost.Cost.ToString("F2", culture)}"); } Console.WriteLine("```"); @@ -110,7 +111,8 @@ public override Task WriteAccumulatedCost(AccumulatedCostSettings settings,Accum Console.WriteLine(" title Cost by location"); foreach (var cost in accumulatedCostDetails.ByLocationCosts.TrimList(threshold: settings.OthersCutoff)) { - Console.WriteLine($" \"{cost.ItemName}\" : {cost.Cost.ToString("F2", culture)}"); + var name = string.IsNullOrWhiteSpace(cost.ItemName) ? "(Unknown)" : cost.ItemName; + Console.WriteLine($" \"{name}\" : {cost.Cost.ToString("F2", culture)}"); } Console.WriteLine("```"); @@ -131,7 +133,8 @@ public override Task WriteAccumulatedCost(AccumulatedCostSettings settings,Accum Console.WriteLine(" title Cost by resource group"); foreach (var cost in accumulatedCostDetails.ByResourceGroupCosts.TrimList(threshold: settings.OthersCutoff)) { - Console.WriteLine($" \"{cost.ItemName}\" : {cost.Cost.ToString("F2", culture)}"); + var name = string.IsNullOrWhiteSpace(cost.ItemName) ? "(Unknown)" : cost.ItemName; + Console.WriteLine($" \"{name}\" : {cost.Cost.ToString("F2", culture)}"); } Console.WriteLine("```");