build: initial project release
All checks were successful
release / dotnet-release-workflow (push) Successful in 1m23s
All checks were successful
release / dotnet-release-workflow (push) Successful in 1m23s
This commit is contained in:
commit
48c483c568
62 changed files with 4957 additions and 0 deletions
25
src/process.dummy.app/_commands/EchoCommand.cs
Normal file
25
src/process.dummy.app/_commands/EchoCommand.cs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
// Copyright (c) The Geekeey Authors
|
||||
// SPDX-License-Identifier: EUPL-1.2
|
||||
|
||||
using Spectre.Console.Cli;
|
||||
|
||||
internal sealed class EchoCommand : AsyncOutputCommand<EchoCommand.Settings>
|
||||
{
|
||||
public sealed class Settings : OutputCommandSettings
|
||||
{
|
||||
[CommandOption("--separator <char>")] public string Separator { get; init; } = " ";
|
||||
[CommandArgument(0, "[line]")] public string[] Items { get; init; } = [];
|
||||
}
|
||||
|
||||
public override async Task<int> ExecuteAsync(CommandContext context, Settings settings, CancellationToken cancellationToken)
|
||||
{
|
||||
using var output = Output.Connect();
|
||||
|
||||
foreach (var writer in output.GetWriters(settings.Target))
|
||||
{
|
||||
await writer.WriteLineAsync(string.Join(settings.Separator, settings.Items));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue