21 lines
No EOL
536 B
C#
21 lines
No EOL
536 B
C#
using Spectre.Console.Cli;
|
|
|
|
namespace Geekeey.Extensions.Process.Tests.Dummy.Commands;
|
|
|
|
internal sealed class EnvironmentCommand : Command<EnvironmentCommand.Settings>
|
|
{
|
|
public sealed class Settings : CommandSettings
|
|
{
|
|
[CommandArgument(0, "<ARGUMENT>")] public string[] Variables { get; init; } = [];
|
|
}
|
|
|
|
public override int Execute(CommandContext context, Settings settings)
|
|
{
|
|
foreach (var name in settings.Variables)
|
|
{
|
|
Console.Out.WriteLine(Environment.GetEnvironmentVariable(name) ?? string.Empty);
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
} |