No description
- C# 100%
|
All checks were successful
default / dotnet-default-workflow (push) Successful in 1m16s
This also removes the description from the package readme. The desciption of the package is shown on nuget.org in the list view and if no package readme is defined on the detail view of a package version. Since we provide a package readme we do not need the description shown twice. |
||
|---|---|---|
| .forgejo/workflows | ||
| src | ||
| .editorconfig | ||
| .gitignore | ||
| CHANGELOG.md | ||
| Directory.Build.props | ||
| Directory.Build.targets | ||
| Directory.Packages.props | ||
| global.json | ||
| LICENSE.md | ||
| nuget.config | ||
| process.slnx | ||
| README.md | ||
Geekeey.Process
Process is a .NET library for interacting with external command-line interfaces. It provides a convenient model for launching processes, redirecting input and output streams, awaiting completion, handling cancellation, and more.
Features
- Input and Output redirection: flexible piping model, that allows to redirect the process's streams.
- Immutability: The
Commandobject is immutable, ensuring thread safely and allowing sharing of a base configuration.
Getting Started
Install the NuGet package:
dotnet add package Geekeey.Process
You may need to add our NuGet feed to your nuget.config this can be done by running the following command:
dotnet nuget add source -n geekeey https://code.geekeey.de/api/packages/geekeey/nuget/index.json
Usage
public static Task<int> Main()
{
var stdout = new StringBuilder();
var cmd = new Command("git").WithArguments(["config", "--get", "user.name"]) | stdout;
await cmd.ExecuteAsync();
Console.WriteLine(stdout.ToString());
return 0;
}
public static Task<int> Main()
{
var stdout = new StringBuilder();
var cmd = new Command("cat").WithArguments(["file.txt"]) | new Command("wc") | stdout;
await cmd.ExecuteAsync();
Console.WriteLine(stdout.ToString());
return 0;
}