CmdOneLiner.NET 1.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package CmdOneLiner.NET --version 1.0.2                
NuGet\Install-Package CmdOneLiner.NET -Version 1.0.2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CmdOneLiner.NET" Version="1.0.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CmdOneLiner.NET --version 1.0.2                
#r "nuget: CmdOneLiner.NET, 1.0.2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install CmdOneLiner.NET as a Cake Addin
#addin nuget:?package=CmdOneLiner.NET&version=1.0.2

// Install CmdOneLiner.NET as a Cake Tool
#tool nuget:?package=CmdOneLiner.NET&version=1.0.2                

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 Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  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 is compatible. 
.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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETCoreApp 3.1

    • No dependencies.
  • .NETStandard 2.1

    • No dependencies.
  • net5.0

    • No dependencies.
  • net6.0

    • 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.

Version Downloads Last updated
2.2.0 1,769 11/22/2024
2.1.0 809 1/31/2023
2.0.0 297 1/21/2023
1.0.4 306 1/7/2023
1.0.3 817 1/7/2023
1.0.2 487 5/30/2021
1.0.1 308 5/21/2021
1.0.0 386 5/21/2021