ConFlag 1.0.0

dotnet add package ConFlag --version 1.0.0
                    
NuGet\Install-Package ConFlag -Version 1.0.0
                    
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="ConFlag" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ConFlag" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="ConFlag" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ConFlag --version 1.0.0
                    
#r "nuget: ConFlag, 1.0.0"
                    
#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.
#:package ConFlag@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ConFlag&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=ConFlag&version=1.0.0
                    
Install as a Cake Tool

ConFlag

ConFlag is a simple single-class package to help you lightweightly manage your command line arguments.

Usage

Command line arguments are split into three groups: flags, options and commands.

If an argument starts with a single dash (-), followed by one or more letters, then they are interpreted as flags. Accessed via Arguments.Flags list.

If an argument starts with a double dash (--), followed by a string of text, then it is interpreted as an option. Option can optionally be followed by an equals sign (=) with a string of text following it (for example --sort=reverse), then the value after the equals sign will be interpreted as the current option's value. Accessed via Arguments.Options (string, string?) dictionary.

Lastly, a string of text not preceded by a dash or double dash is interpreted as a command (subcommand). Accessed via Arguments.Commands list.


using System;
using ConFlag;

namespace Example {

    class Example {
        static void Main(string[] args) {

            // create the ConFlag Arguments class
            Arguments arguments = new(args);

            // check if -h or --help were passed as arguments
            if(
                arguments.Flags.Contains('h') ||
                arguments.Options.ContainsKey("help")
                ) 
            {
                Console.WriteLine("Example program usage: ...");
            }
        }
    }
}

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 177 10/26/2024