diff --git a/src/All.slnx b/src/All.slnx
index cce54994251..067ed9ad994 100644
--- a/src/All.slnx
+++ b/src/All.slnx
@@ -342,7 +342,6 @@
-
diff --git a/src/Nitro/CommandLine/Nitro.CommandLine.slnx b/src/Nitro/CommandLine/Nitro.CommandLine.slnx
index 79266a53518..9d149b60071 100644
--- a/src/Nitro/CommandLine/Nitro.CommandLine.slnx
+++ b/src/Nitro/CommandLine/Nitro.CommandLine.slnx
@@ -1,7 +1,6 @@
-
diff --git a/src/Nitro/CommandLine/src/CommandLine.Core/Helpers/ConsoleHelpers.cs b/src/Nitro/CommandLine/src/CommandLine.Core/Helpers/ConsoleHelpers.cs
deleted file mode 100644
index 25d790cf062..00000000000
--- a/src/Nitro/CommandLine/src/CommandLine.Core/Helpers/ConsoleHelpers.cs
+++ /dev/null
@@ -1,160 +0,0 @@
-using System.CommandLine.Invocation;
-
-namespace ChilliCream.Nitro.CommandLine;
-
-public static class ConsoleHelpers
-{
- public static void Log(this IAnsiConsole console, string str)
- {
- console.MarkupLine("[grey]LOG: [/]" + str);
- }
-
- public static Status DefaultStatus(this IAnsiConsole console)
- {
- return console.Status()
- .Spinner(Spinner.Known.BouncingBar)
- .SpinnerStyle(Style.Parse("green bold"));
- }
-
- public static void Title(this IAnsiConsole console, string str)
- {
- console.MarkupLineInterpolated($"[white bold]{str}:[/]");
- console.WriteLine();
- }
-
- public static void Success(this IAnsiConsole console, string message)
- {
- console.MarkupLine($"[green bold]{message}[/]");
- }
-
- public static void OkLine(this IAnsiConsole console, string message)
- {
- console.MarkupLine(Glyphs.Check.Space() + message);
- }
-
- public static void ErrorLine(this IAnsiConsole console, string message)
- {
- console.MarkupLine(Glyphs.Cross.Space() + message);
- }
-
- public static void ErrorLine(this TextWriter textWriter, string message)
- {
- textWriter.WriteLine("❌ " + message);
- }
-
- public static void OkQuestion(this IAnsiConsole console, string question, string result)
- {
- console.MarkupLine(
- $"{Glyphs.QuestionMark.Space()}[bold]{question}[/]: [darkseagreen4]{result}[/]");
- }
-
- public static async Task OptionOrAskAsync(
- this InvocationContext context,
- string question,
- Option option,
- string? defaultValue,
- CancellationToken cancellationToken)
- {
- var value = context.ParseResult.GetValueForOption(option);
-
- if (value is not null)
- {
- return value;
- }
-
- var console = context.BindingContext.GetRequiredService();
-
- var prompt = new TextPrompt(question.AsQuestion());
-
- if (defaultValue is not null)
- {
- prompt = prompt.DefaultValue(defaultValue);
- }
-
- return await prompt.ShowAsync(console, cancellationToken);
- }
-
- public static Task OptionOrAskAsync(
- this InvocationContext context,
- string question,
- Option option,
- CancellationToken cancellationToken)
- => OptionOrAskAsync(context, question, option, defaultValue: null, cancellationToken);
-
- public static async Task AskAsync(
- this IAnsiConsole console,
- string question,
- string defaultValue,
- CancellationToken cancellationToken)
- {
- var questionText = $"{question}".AsQuestion();
- var prompt = new TextPrompt(questionText).DefaultValue(defaultValue);
- return await prompt.ShowAsync(console, cancellationToken);
- }
-
- public static async Task ConfirmAsync(
- this IAnsiConsole console,
- string question,
- CancellationToken cancellationToken)
- => await new ConfirmationPrompt(question.AsQuestion())
- .ShowAsync(console, cancellationToken);
-
- public static async Task OptionOrConfirmAsync(
- this InvocationContext context,
- string question,
- Option option,
- CancellationToken cancellationToken)
- {
- var value = context.ParseResult.GetValueForOption(option);
-
- if (value is not null)
- {
- return value.Value;
- }
-
- var console = context.BindingContext.GetRequiredService();
-
- return await new ConfirmationPrompt(question.AsQuestion())
- .ShowAsync(console, cancellationToken);
- }
-
- public static void WarningLine(this IAnsiConsole console, string message)
- {
- console.MarkupLine(Glyphs.ExclamationMark.Space() + message);
- }
-
- public static bool IsHumanReadable(this IAnsiConsole console)
- {
- return console is IExtendedConsole { IsInteractive: true };
- }
-
- public static IDisposable UseInteractive(this IAnsiConsole console)
- {
- return new InteractiveScope(console);
- }
-
- private sealed class InteractiveScope : IDisposable
- {
- private readonly IAnsiConsole _console;
- private readonly bool _originalValue;
-
- public InteractiveScope(IAnsiConsole console)
- {
- _console = console;
-
- if (_console is IExtendedConsole customConsole)
- {
- _originalValue = customConsole.IsInteractive;
- customConsole.IsInteractive = true;
- }
- }
-
- public void Dispose()
- {
- if (_console is IExtendedConsole customConsole)
- {
- customConsole.IsInteractive = _originalValue;
- }
- }
- }
-}
diff --git a/src/Nitro/CommandLine/src/CommandLine.Core/Helpers/ConsoleStringExtensions.cs b/src/Nitro/CommandLine/src/CommandLine.Core/Helpers/ConsoleStringExtensions.cs
deleted file mode 100644
index 2fbba0e24d7..00000000000
--- a/src/Nitro/CommandLine/src/CommandLine.Core/Helpers/ConsoleStringExtensions.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-namespace ChilliCream.Nitro.CommandLine;
-
-internal static class ConsoleStringExtensions
-{
- public static string Space(this string str)
- {
- return $"{str} ";
- }
-
- public static string AsQuestion(this string str)
- {
- return $"{Glyphs.QuestionMark} [bold]{str}[/]";
- }
-}
diff --git a/src/Nitro/CommandLine/src/CommandLine.Core/Helpers/ExitCodes.cs b/src/Nitro/CommandLine/src/CommandLine.Core/Helpers/ExitCodes.cs
deleted file mode 100644
index 7c10f270558..00000000000
--- a/src/Nitro/CommandLine/src/CommandLine.Core/Helpers/ExitCodes.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-namespace ChilliCream.Nitro.CommandLine;
-
-public static class ExitCodes
-{
- public const int Success = 0;
-
- public const int Error = -1;
-}
diff --git a/src/Nitro/CommandLine/src/CommandLine.Core/Nitro.CommandLine.Core.csproj b/src/Nitro/CommandLine/src/CommandLine.Core/Nitro.CommandLine.Core.csproj
deleted file mode 100644
index 1014c58fcf7..00000000000
--- a/src/Nitro/CommandLine/src/CommandLine.Core/Nitro.CommandLine.Core.csproj
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
- ChilliCream.Nitro.CommandLine
- ChilliCream.Nitro.CommandLine.Core
- ChilliCream.Nitro.CommandLine.Core
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/Nitro/CommandLine/src/CommandLine/Commands/Apis/Inputs/ApiInvocationContextExtensions.cs b/src/Nitro/CommandLine/src/CommandLine/Commands/Apis/Inputs/ApiInvocationContextExtensions.cs
index 6e7b0061c8d..716d47de2f5 100644
--- a/src/Nitro/CommandLine/src/CommandLine/Commands/Apis/Inputs/ApiInvocationContextExtensions.cs
+++ b/src/Nitro/CommandLine/src/CommandLine/Commands/Apis/Inputs/ApiInvocationContextExtensions.cs
@@ -1,6 +1,7 @@
using System.CommandLine.Invocation;
using ChilliCream.Nitro.CommandLine.Client;
using ChilliCream.Nitro.CommandLine.Commands.Apis.Components;
+using ChilliCream.Nitro.CommandLine.Helpers;
using ChilliCream.Nitro.CommandLine.Options;
using ChilliCream.Nitro.CommandLine.Services.Sessions;
diff --git a/src/Nitro/CommandLine/src/CommandLine/Commands/Clients/DownloadClientCommand.cs b/src/Nitro/CommandLine/src/CommandLine/Commands/Clients/DownloadClientCommand.cs
index c006ad1a46b..7399c3d8e6b 100644
--- a/src/Nitro/CommandLine/src/CommandLine/Commands/Clients/DownloadClientCommand.cs
+++ b/src/Nitro/CommandLine/src/CommandLine/Commands/Clients/DownloadClientCommand.cs
@@ -1,6 +1,7 @@
using System.Text.Json;
using ChilliCream.Nitro.CommandLine.Client;
using ChilliCream.Nitro.CommandLine.Configuration;
+using ChilliCream.Nitro.CommandLine.Helpers;
using ChilliCream.Nitro.CommandLine.Options;
using ChilliCream.Nitro.CommandLine.Services.Configuration;
diff --git a/src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionDownloadCommand.cs b/src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionDownloadCommand.cs
index 93d6a59df16..a8cb03cc262 100644
--- a/src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionDownloadCommand.cs
+++ b/src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionDownloadCommand.cs
@@ -1,6 +1,7 @@
using System.CommandLine.Invocation;
using ChilliCream.Nitro.CommandLine.Client;
using ChilliCream.Nitro.CommandLine.Configuration;
+using ChilliCream.Nitro.CommandLine.Helpers;
using ChilliCream.Nitro.CommandLine.Options;
using ChilliCream.Nitro.CommandLine.Services.Sessions;
diff --git a/src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionPublishCommand.cs b/src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionPublishCommand.cs
index b7bad6ca1e5..430bc9f63fb 100644
--- a/src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionPublishCommand.cs
+++ b/src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionPublishCommand.cs
@@ -2,6 +2,7 @@
using System.Text.Json;
using ChilliCream.Nitro.CommandLine.Client;
using ChilliCream.Nitro.CommandLine.Commands.Fusion.PublishCommand;
+using ChilliCream.Nitro.CommandLine.Helpers;
using ChilliCream.Nitro.CommandLine.Options;
using ChilliCream.Nitro.CommandLine.Settings;
using HotChocolate.Fusion;
diff --git a/src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionRunCommand.cs b/src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionRunCommand.cs
index 99aff4d03ef..f9b170c8c2f 100644
--- a/src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionRunCommand.cs
+++ b/src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionRunCommand.cs
@@ -2,6 +2,7 @@
using System.Net;
using System.Net.Sockets;
using System.Runtime.InteropServices;
+using ChilliCream.Nitro.CommandLine.Helpers;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
diff --git a/src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionSettingsSetCommand.cs b/src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionSettingsSetCommand.cs
index c68be2ea053..7f8cdc4686c 100644
--- a/src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionSettingsSetCommand.cs
+++ b/src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/FusionSettingsSetCommand.cs
@@ -1,4 +1,5 @@
using ChilliCream.Nitro.CommandLine.Client;
+using ChilliCream.Nitro.CommandLine.Helpers;
using ChilliCream.Nitro.CommandLine.Options;
using ChilliCream.Nitro.CommandLine.Settings;
diff --git a/src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/PublishCommand/FusionConfigurationPublishBeginCommand.cs b/src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/PublishCommand/FusionConfigurationPublishBeginCommand.cs
index c2241a6359f..3e71fd93c53 100644
--- a/src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/PublishCommand/FusionConfigurationPublishBeginCommand.cs
+++ b/src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/PublishCommand/FusionConfigurationPublishBeginCommand.cs
@@ -1,6 +1,7 @@
using System.CommandLine.Invocation;
using ChilliCream.Nitro.CommandLine.Client;
using ChilliCream.Nitro.CommandLine.Configuration;
+using ChilliCream.Nitro.CommandLine.Helpers;
using ChilliCream.Nitro.CommandLine.Options;
using ChilliCream.Nitro.CommandLine.Results;
using ChilliCream.Nitro.CommandLine.Services.Configuration;
diff --git a/src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/PublishCommand/FusionConfigurationPublishCancelCommand.cs b/src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/PublishCommand/FusionConfigurationPublishCancelCommand.cs
index e01bc91e7c9..08b2ee861e6 100644
--- a/src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/PublishCommand/FusionConfigurationPublishCancelCommand.cs
+++ b/src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/PublishCommand/FusionConfigurationPublishCancelCommand.cs
@@ -1,6 +1,7 @@
using System.CommandLine.Invocation;
using ChilliCream.Nitro.CommandLine.Client;
using ChilliCream.Nitro.CommandLine.Configuration;
+using ChilliCream.Nitro.CommandLine.Helpers;
using ChilliCream.Nitro.CommandLine.Options;
using ChilliCream.Nitro.CommandLine.Services.Sessions;
diff --git a/src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/PublishCommand/FusionConfigurationPublishStartCommand.cs b/src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/PublishCommand/FusionConfigurationPublishStartCommand.cs
index 5a1b76b7147..c9f38106448 100644
--- a/src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/PublishCommand/FusionConfigurationPublishStartCommand.cs
+++ b/src/Nitro/CommandLine/src/CommandLine/Commands/Fusion/PublishCommand/FusionConfigurationPublishStartCommand.cs
@@ -1,6 +1,7 @@
using System.CommandLine.Invocation;
using ChilliCream.Nitro.CommandLine.Client;
using ChilliCream.Nitro.CommandLine.Configuration;
+using ChilliCream.Nitro.CommandLine.Helpers;
using ChilliCream.Nitro.CommandLine.Options;
using ChilliCream.Nitro.CommandLine.Services.Sessions;
diff --git a/src/Nitro/CommandLine/src/CommandLine/Commands/Login/LoginCommand.cs b/src/Nitro/CommandLine/src/CommandLine/Commands/Login/LoginCommand.cs
index a5ab9f38d9e..0963822514e 100644
--- a/src/Nitro/CommandLine/src/CommandLine/Commands/Login/LoginCommand.cs
+++ b/src/Nitro/CommandLine/src/CommandLine/Commands/Login/LoginCommand.cs
@@ -1,6 +1,7 @@
using ChilliCream.Nitro.CommandLine.Client;
using ChilliCream.Nitro.CommandLine.Commands.Workspaces;
using ChilliCream.Nitro.CommandLine.Configuration;
+using ChilliCream.Nitro.CommandLine.Helpers;
using ChilliCream.Nitro.CommandLine.Options;
using ChilliCream.Nitro.CommandLine.Services.Sessions;
diff --git a/src/Nitro/CommandLine/src/CommandLine/Commands/Logout/LogoutCommand.cs b/src/Nitro/CommandLine/src/CommandLine/Commands/Logout/LogoutCommand.cs
index 8aff82e50db..3f3422aa8f8 100644
--- a/src/Nitro/CommandLine/src/CommandLine/Commands/Logout/LogoutCommand.cs
+++ b/src/Nitro/CommandLine/src/CommandLine/Commands/Logout/LogoutCommand.cs
@@ -1,5 +1,6 @@
using ChilliCream.Nitro.CommandLine.Client;
using ChilliCream.Nitro.CommandLine.Configuration;
+using ChilliCream.Nitro.CommandLine.Helpers;
using ChilliCream.Nitro.CommandLine.Services.Sessions;
namespace ChilliCream.Nitro.CommandLine.Commands.Logout;
diff --git a/src/Nitro/CommandLine/src/CommandLine/Commands/Schemas/DownloadSchemaCommand.cs b/src/Nitro/CommandLine/src/CommandLine/Commands/Schemas/DownloadSchemaCommand.cs
index f44ed90a4da..b1181c6b3bf 100644
--- a/src/Nitro/CommandLine/src/CommandLine/Commands/Schemas/DownloadSchemaCommand.cs
+++ b/src/Nitro/CommandLine/src/CommandLine/Commands/Schemas/DownloadSchemaCommand.cs
@@ -1,5 +1,6 @@
using ChilliCream.Nitro.CommandLine.Client;
using ChilliCream.Nitro.CommandLine.Configuration;
+using ChilliCream.Nitro.CommandLine.Helpers;
using ChilliCream.Nitro.CommandLine.Options;
namespace ChilliCream.Nitro.CommandLine.Commands.Schemas;
diff --git a/src/Nitro/CommandLine/src/CommandLine.Core/ExitException.cs b/src/Nitro/CommandLine/src/CommandLine/ExitException.cs
similarity index 100%
rename from src/Nitro/CommandLine/src/CommandLine.Core/ExitException.cs
rename to src/Nitro/CommandLine/src/CommandLine/ExitException.cs
diff --git a/src/Nitro/CommandLine/src/CommandLine.Core/Result/ExtendedConsole.cs b/src/Nitro/CommandLine/src/CommandLine/ExtendedConsole.cs
similarity index 100%
rename from src/Nitro/CommandLine/src/CommandLine.Core/Result/ExtendedConsole.cs
rename to src/Nitro/CommandLine/src/CommandLine/ExtendedConsole.cs
diff --git a/src/Nitro/CommandLine/src/CommandLine.Core/Extensions/CommandLineBuilderExtensions.cs b/src/Nitro/CommandLine/src/CommandLine/Extensions/CommandLineBuilderExtensions.cs
similarity index 98%
rename from src/Nitro/CommandLine/src/CommandLine.Core/Extensions/CommandLineBuilderExtensions.cs
rename to src/Nitro/CommandLine/src/CommandLine/Extensions/CommandLineBuilderExtensions.cs
index e047527766e..27aacc8311d 100644
--- a/src/Nitro/CommandLine/src/CommandLine.Core/Extensions/CommandLineBuilderExtensions.cs
+++ b/src/Nitro/CommandLine/src/CommandLine/Extensions/CommandLineBuilderExtensions.cs
@@ -1,5 +1,6 @@
using System.CommandLine.Builder;
using System.CommandLine.Invocation;
+using ChilliCream.Nitro.CommandLine.Helpers;
namespace ChilliCream.Nitro.CommandLine;
diff --git a/src/Nitro/CommandLine/src/CommandLine/Helpers/ConsoleHelpers.cs b/src/Nitro/CommandLine/src/CommandLine/Helpers/ConsoleHelpers.cs
index 92d05e4ebfc..563cf5722ff 100644
--- a/src/Nitro/CommandLine/src/CommandLine/Helpers/ConsoleHelpers.cs
+++ b/src/Nitro/CommandLine/src/CommandLine/Helpers/ConsoleHelpers.cs
@@ -1,3 +1,4 @@
+using System.CommandLine.Invocation;
using ChilliCream.Nitro.CommandLine.Client;
using StrawberryShake;
@@ -249,4 +250,158 @@ private static void PrintMutationError(this IAnsiConsole ansiConsole, object err
break;
}
}
+
+ public static void Log(this IAnsiConsole console, string str)
+ {
+ console.MarkupLine("[grey]LOG: [/]" + str);
+ }
+
+ public static Status DefaultStatus(this IAnsiConsole console)
+ {
+ return console.Status()
+ .Spinner(Spinner.Known.BouncingBar)
+ .SpinnerStyle(Style.Parse("green bold"));
+ }
+
+ public static void Title(this IAnsiConsole console, string str)
+ {
+ console.MarkupLineInterpolated($"[white bold]{str}:[/]");
+ console.WriteLine();
+ }
+
+ public static void Success(this IAnsiConsole console, string message)
+ {
+ console.MarkupLine($"[green bold]{message}[/]");
+ }
+
+ public static void OkLine(this IAnsiConsole console, string message)
+ {
+ console.MarkupLine(Glyphs.Check.Space() + message);
+ }
+
+ public static void ErrorLine(this IAnsiConsole console, string message)
+ {
+ console.MarkupLine(Glyphs.Cross.Space() + message);
+ }
+
+ public static void ErrorLine(this TextWriter textWriter, string message)
+ {
+ textWriter.WriteLine("❌ " + message);
+ }
+
+ public static void OkQuestion(this IAnsiConsole console, string question, string result)
+ {
+ console.MarkupLine(
+ $"{Glyphs.QuestionMark.Space()}[bold]{question}[/]: [darkseagreen4]{result}[/]");
+ }
+
+ public static async Task OptionOrAskAsync(
+ this InvocationContext context,
+ string question,
+ Option option,
+ string? defaultValue,
+ CancellationToken cancellationToken)
+ {
+ var value = context.ParseResult.GetValueForOption(option);
+
+ if (value is not null)
+ {
+ return value;
+ }
+
+ var console = context.BindingContext.GetRequiredService();
+
+ var prompt = new TextPrompt(question.AsQuestion());
+
+ if (defaultValue is not null)
+ {
+ prompt = prompt.DefaultValue(defaultValue);
+ }
+
+ return await prompt.ShowAsync(console, cancellationToken);
+ }
+
+ public static Task OptionOrAskAsync(
+ this InvocationContext context,
+ string question,
+ Option option,
+ CancellationToken cancellationToken)
+ => OptionOrAskAsync(context, question, option, defaultValue: null, cancellationToken);
+
+ public static async Task AskAsync(
+ this IAnsiConsole console,
+ string question,
+ string defaultValue,
+ CancellationToken cancellationToken)
+ {
+ var questionText = $"{question}".AsQuestion();
+ var prompt = new TextPrompt(questionText).DefaultValue(defaultValue);
+ return await prompt.ShowAsync(console, cancellationToken);
+ }
+
+ public static async Task ConfirmAsync(
+ this IAnsiConsole console,
+ string question,
+ CancellationToken cancellationToken)
+ => await new ConfirmationPrompt(question.AsQuestion())
+ .ShowAsync(console, cancellationToken);
+
+ public static async Task OptionOrConfirmAsync(
+ this InvocationContext context,
+ string question,
+ Option option,
+ CancellationToken cancellationToken)
+ {
+ var value = context.ParseResult.GetValueForOption(option);
+
+ if (value is not null)
+ {
+ return value.Value;
+ }
+
+ var console = context.BindingContext.GetRequiredService();
+
+ return await new ConfirmationPrompt(question.AsQuestion())
+ .ShowAsync(console, cancellationToken);
+ }
+
+ public static void WarningLine(this IAnsiConsole console, string message)
+ {
+ console.MarkupLine(Glyphs.ExclamationMark.Space() + message);
+ }
+
+ public static bool IsHumanReadable(this IAnsiConsole console)
+ {
+ return console is IExtendedConsole { IsInteractive: true };
+ }
+
+ public static IDisposable UseInteractive(this IAnsiConsole console)
+ {
+ return new InteractiveScope(console);
+ }
+
+ private sealed class InteractiveScope : IDisposable
+ {
+ private readonly IAnsiConsole _console;
+ private readonly bool _originalValue;
+
+ public InteractiveScope(IAnsiConsole console)
+ {
+ _console = console;
+
+ if (_console is IExtendedConsole customConsole)
+ {
+ _originalValue = customConsole.IsInteractive;
+ customConsole.IsInteractive = true;
+ }
+ }
+
+ public void Dispose()
+ {
+ if (_console is IExtendedConsole customConsole)
+ {
+ customConsole.IsInteractive = _originalValue;
+ }
+ }
+ }
}
diff --git a/src/Nitro/CommandLine/src/CommandLine/Helpers/ConsoleStringExtensions.cs b/src/Nitro/CommandLine/src/CommandLine/Helpers/ConsoleStringExtensions.cs
index 2adc68b6006..f0ff0b52a60 100644
--- a/src/Nitro/CommandLine/src/CommandLine/Helpers/ConsoleStringExtensions.cs
+++ b/src/Nitro/CommandLine/src/CommandLine/Helpers/ConsoleStringExtensions.cs
@@ -33,15 +33,9 @@ public static string AsIcon(this bool value)
{
return value ? Glyphs.Check : Glyphs.Cross;
}
-}
-
-internal static class Glyphs
-{
- public const string Check = "[green bold]✓[/]";
-
- public const string Cross = "[red bold]✕[/]";
- public const string QuestionMark = "[lime bold]?[/]";
-
- public const string ExclamationMark = "[yellow bold]![/]";
+ public static string AsQuestion(this string str)
+ {
+ return $"{Glyphs.QuestionMark} [bold]{str}[/]";
+ }
}
diff --git a/src/Nitro/CommandLine/src/CommandLine.Core/Helpers/Glyphs.cs b/src/Nitro/CommandLine/src/CommandLine/Helpers/Glyphs.cs
similarity index 100%
rename from src/Nitro/CommandLine/src/CommandLine.Core/Helpers/Glyphs.cs
rename to src/Nitro/CommandLine/src/CommandLine/Helpers/Glyphs.cs
diff --git a/src/Nitro/CommandLine/src/CommandLine.Core/Result/IExtendedConsole.cs b/src/Nitro/CommandLine/src/CommandLine/IExtendedConsole.cs
similarity index 100%
rename from src/Nitro/CommandLine/src/CommandLine.Core/Result/IExtendedConsole.cs
rename to src/Nitro/CommandLine/src/CommandLine/IExtendedConsole.cs
diff --git a/src/Nitro/CommandLine/src/CommandLine/Nitro.CommandLine.csproj b/src/Nitro/CommandLine/src/CommandLine/Nitro.CommandLine.csproj
index e63f6c57b60..79aaf24d957 100644
--- a/src/Nitro/CommandLine/src/CommandLine/Nitro.CommandLine.csproj
+++ b/src/Nitro/CommandLine/src/CommandLine/Nitro.CommandLine.csproj
@@ -31,7 +31,6 @@
-
diff --git a/src/Nitro/CommandLine/src/CommandLine/Services/Sessions/InvocationContextExtensions.cs b/src/Nitro/CommandLine/src/CommandLine/Services/Sessions/InvocationContextExtensions.cs
index 345f5d2f681..73a3a8c634d 100644
--- a/src/Nitro/CommandLine/src/CommandLine/Services/Sessions/InvocationContextExtensions.cs
+++ b/src/Nitro/CommandLine/src/CommandLine/Services/Sessions/InvocationContextExtensions.cs
@@ -1,4 +1,5 @@
using System.CommandLine.Invocation;
+using ChilliCream.Nitro.CommandLine.Helpers;
using ChilliCream.Nitro.CommandLine.Options;
namespace ChilliCream.Nitro.CommandLine.Services.Sessions;