consolefx - ConsoleFx.ConsoleExtensions 2.0.0-build.423

ConsoleFx is a suite of .NET libraries for building command-line (CLI) applications, including support for a sophisticated command line argument parser, interactive prompts, ASCII art, console capture and extensions to the Console class.

The ConsoleFx.ConsoleExtensions package provides enhancements to the Console class.

PM> Install-Package ConsoleFx.ConsoleExtensions -Version 2.0.0-build.423 -Source https://www.myget.org/F/consolefx/api/v3/index.json

Copy to clipboard

> nuget.exe install ConsoleFx.ConsoleExtensions -Version 2.0.0-build.423 -Source https://www.myget.org/F/consolefx/api/v3/index.json

Copy to clipboard

> dotnet add package ConsoleFx.ConsoleExtensions --version 2.0.0-build.423 --source https://www.myget.org/F/consolefx/api/v3/index.json

Copy to clipboard
<PackageReference Include="ConsoleFx.ConsoleExtensions" Version="2.0.0-build.423" />
Copy to clipboard
source https://www.myget.org/F/consolefx/api/v3/index.json

nuget ConsoleFx.ConsoleExtensions  ~> 2.0.0-build.423
Copy to clipboard

> choco install ConsoleFx.ConsoleExtensions --version 2.0.0-build.423 --source https://www.myget.org/F/consolefx/api/v2

Copy to clipboard
Import-Module PowerShellGet
Register-PSRepository -Name "consolefx" -SourceLocation "https://www.myget.org/F/consolefx/api/v2"
Install-Module -Name "ConsoleFx.ConsoleExtensions" -RequiredVersion "2.0.0-build.423" -Repository "consolefx" -AllowPreRelease
Copy to clipboard

Browse the sources in this package using Visual Studio or WinDbg by configuring the following legacy symbol server URL: https://www.myget.org/F/consolefx/symbols/


ConsoleFx

ConsoleFx

Build status Test status codecov

ConsoleFx is a suite of .NET libraries for building command-line (CLI) applications.

Build console apps with command line arguments

The following code simulates the following made-up console app:

COPY <source file> [<destination dir>] [--overwrite] [--create-dir]

public class Program : ConsoleProgram
{
    // Declare one property per argument and option.
    
    public string SourceFile { get; set; }
    
    public string DestinationDir { get; set; }
    
    [Option("overwrite")]
    public bool OverwriteExistingFile { get; set; }
    
    [Option("create-dir")]
    public bool CreateDirIfMissing { get; set; }
    
    // Code to execute the console program if all command line args are verified.
    protected int HandleCommand()
    {
        Console.WriteLine($"You want to copy {SourceFile} to {DestinationDir}");
        Console.WriteLine($"Overwrite file if it exists: {OverwriteExistingFile}");
        Console.WriteLine($"Create destination directory if it does not exist: {CreateDirIfMissing}");
        return 0;
    }
    
    // Specify the options and arguments that are accepted by the console app
    protected override IEnumerable<Arg> GetArgs()
    {
        yield return new Argument(nameof(SourceFile))
            .ValidateAsFile(shouldExist: true);
        yield return new Argument(nameof(DestinationDir), optional: true)
            .ValidateAsDirectory();
        yield return new Option("overwrite", "o")
            .UsedAsFlag();
        yield return new Option("create-dir", "c")
            .UsedAsFlag();
    }
    
    public static int Main()
    {
        var program = new Program();
        return program.Run();
    }
}

Packages

ConsoleFx consists of the following NuGet packages. Development packages from continuous integration builds are available on MyGet.

Package Description Dev Build
ConsoleFx.CmdLine.Program Write command line programs with sophisticated argument parsing, including error handling, automatic help generation and rich validation support. Supports both Unix and Windows-style arguments. ConsoleFx.CmdLine.Program
ConsoleFx.CmdLine.Parser Standalone argument parser that is used by ConsoleFx.CmdLine.Program. Can be used in non-console program such as Windows Forms, WPF, REPL, etc. to parse command line arguments in a similar fashion. ConsoleFx.CmdLine.Parser
ConsoleFx.ConsoleExtensions Extended console capabilities like color output, prompts, inputting secrets, outputting indented text, progress bars, etc. ConsoleFx.ConsoleExtensions
ConsoleFx.Prompter Rich interactive framework from getting inputs from users. Inspired by the Inquirer.js framework for JavaScript. ConsoleFx.Prompter

Metapackage

ConsoleFx includes a metapackage that contains all the major packages that would typically needed to build a complex console application.

NuGet Version NuGet Downloads ConsoleFx

Under development

The following packages are under development and expected in a future release.

Package Description Expected Version
ConsoleFx.Art Output ASCII art in different styles. 2.1
ConsoleFx.UI Dynamic creation of Windows Forms and WPF UI to visually input command-line arguments. TBD
  • .NETStandard 2.0
    • Spectre.Console (>= 0.42.0)
  • .NETStandard 2.0: 2.0.0.0

                        
Assembly Assembly hash Match
/lib/netstandard2.0/consolefx.consoleextensions.dll 99032f27efd74c83afa77fe786170ad6FFFFFFFF

Owners

Jeevan James

Authors

Jeevan James

Project URL

https://github.com/JeevanJames/ConsoleFx/

License

Apache-2.0

Tags

ConsoleFx Console Command Commandline Command-line Cmdline Parser CMD CLI

Info

0 total downloads
0 downloads for version 2.0.0-build.423
Download (24.69 KB)
Download legacy symbols (24.69 KB)
Found on the current feed only

Package history

Version Size Last updated Downloads Mirrored?
2.0.0-build.423 24.69 KB Sat, 21 May 2022 15:08:00 GMT 0
2.0.0-build.422 24.69 KB Wed, 18 May 2022 20:55:31 GMT 0
2.0.0-build.421 24.69 KB Wed, 18 May 2022 20:46:13 GMT 0
2.0.0-build.420 78.14 KB Thu, 14 Oct 2021 16:07:54 GMT 0
2.0.0-build.419 78.14 KB Wed, 06 Oct 2021 19:56:20 GMT 0
2.0.0-build.418 78.15 KB Wed, 06 Oct 2021 15:40:46 GMT 0
2.0.0-build.417 78.14 KB Tue, 05 Oct 2021 22:37:52 GMT 0
2.0.0-build.416 78.15 KB Tue, 05 Oct 2021 14:10:42 GMT 0
2.0.0-build.415 78.13 KB Tue, 05 Oct 2021 13:56:15 GMT 0
2.0.0-build.413 78.1 KB Wed, 29 Sep 2021 20:00:03 GMT 0
2.0.0-build.411 78.1 KB Wed, 29 Sep 2021 19:46:34 GMT 0
2.0.0-build.410 78.11 KB Wed, 29 Sep 2021 13:24:35 GMT 0
2.0.0-build.409 78.1 KB Thu, 23 Sep 2021 08:34:37 GMT 0
2.0.0-build.408 78.1 KB Wed, 22 Sep 2021 21:29:15 GMT 0
2.0.0-build.407 78.13 KB Wed, 22 Sep 2021 16:11:36 GMT 0
2.0.0-build.406 78.11 KB Wed, 22 Sep 2021 15:31:49 GMT 0
2.0.0-build.405 78.11 KB Sat, 18 Sep 2021 10:41:13 GMT 0
2.0.0-build.403 78.1 KB Sat, 18 Sep 2021 10:35:09 GMT 0
2.0.0-build.401 57.18 KB Tue, 14 Sep 2021 23:17:18 GMT 0
2.0.0-build.399 57.18 KB Fri, 03 Sep 2021 23:19:20 GMT 0
2.0.0-build.267 57.17 KB Thu, 19 Nov 2020 09:02:05 GMT 0