This commit is contained in:
commit
4aa6c48530
52 changed files with 3781 additions and 0 deletions
21
src/Process.Tests.Dummy/Commands/EnvironmentCommand.cs
Normal file
21
src/Process.Tests.Dummy/Commands/EnvironmentCommand.cs
Normal file
|
@ -0,0 +1,21 @@
|
|||
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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue