2022-03-06 13:29:38 +00:00
|
|
|
namespace Aaru.Core;
|
|
|
|
|
|
2022-03-07 07:36:44 +00:00
|
|
|
using System;
|
|
|
|
|
using global::Spectre.Console;
|
|
|
|
|
|
2022-03-18 01:32:22 +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-03-18 01:32:22 +00:00
|
|
|
/// <summary>
|
|
|
|
|
/// Initializes a progress bar with a single spinner
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <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
|
|
|
}
|