2022-03-07 07:36:44 +00:00
|
|
|
using System;
|
2022-11-15 15:58:43 +00:00
|
|
|
using Spectre.Console;
|
|
|
|
|
|
|
|
|
|
namespace Aaru.Core;
|
2022-03-07 07:36:44 +00:00
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
/// <summary>Implement core operations using the Spectre console</summary>
|
2022-03-06 13:29:38 +00:00
|
|
|
public static class Spectre
|
2021-09-13 18:08:44 +01:00
|
|
|
{
|
2022-11-15 15:58:43 +00:00
|
|
|
/// <summary>Initializes a progress bar with a single spinner</summary>
|
2022-03-18 01:32:22 +00:00
|
|
|
/// <param name="action">Action to execute in the progress bar</param>
|
2022-03-07 07:36:44 +00:00
|
|
|
public static void ProgressSingleSpinner(Action<ProgressContext> action) => AnsiConsole.Progress().AutoClear(true).
|
|
|
|
|
HideCompleted(true).Columns(new TaskDescriptionColumn(), new SpinnerColumn()).Start(action);
|
2021-09-13 18:08:44 +01:00
|
|
|
}
|