CmdOneLiner.NET
1.0.0
See the version list below for details.
dotnet add package CmdOneLiner.NET --version 1.0.0
NuGet\Install-Package CmdOneLiner.NET -Version 1.0.0
<PackageReference Include="CmdOneLiner.NET" Version="1.0.0" />
paket add CmdOneLiner.NET --version 1.0.0
#r "nuget: CmdOneLiner.NET, 1.0.0"
// Install CmdOneLiner.NET as a Cake Addin #addin nuget:?package=CmdOneLiner.NET&version=1.0.0 // Install CmdOneLiner.NET as a Cake Tool #tool nuget:?package=CmdOneLiner.NET&version=1.0.0
CmdOneLiner.NET
CmdOneLiner.NET easily executes command-line applications from .NET in a single line of code.
Usage
using System;
namespace CmdOneLinerNET.Sample
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Sleeping for 5 seconds...");
(int ExitCode, bool Success, string StdOut, string StdErr, long MaxRamUsedBytes, TimeSpan UserProcessorTime, TimeSpan TotalProcessorTime) = CmdOneLiner.Run("Sleeper.exe 5", timeout: TimeSpan.FromSeconds(20));
Console.WriteLine($"Sleeper program executed in {UserProcessorTime.TotalSeconds} seconds ({TotalProcessorTime.TotalSeconds}), used {MaxRamUsedBytes / 1024 / 1024} MiB of RAM, and printed to the standard output: \"{StdOut}\".");
}
}
}
Features
- Extremely easy to use.
- Multiplatform (platform agnostic).
- Measures maximum RAM usage and CPU time.
- Optional command execution timeout.
- Optional token allows cancellation from another thread.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- No dependencies.
NuGet packages (2)
Showing the top 2 NuGet packages that depend on CmdOneLiner.NET:
Package | Downloads |
---|---|
Sys.IO.NG
Adds timeout, asynchronous cancellation, and Disk I/O (not CPU) Prioritization to File and Directory read/write operations on Linux. On Windows, it transparently performs File/Directory operations ignoring timeouts/cancellation/priorities (same as System.IO). It also solves Directory.Move() not working on Linux when source and destination are on different drives/mountpoints. |
|
SchrodingersStorage
An simple object-oriented file system abstraction where files and directories can be stored in one directory, two, both, or none. This is useful for accessing data while it is being transfererred between drives. |
GitHub repositories
This package is not used by any popular GitHub repositories.