Redpoint.CommandLine 2024.1320.653

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Redpoint.CommandLine --version 2024.1320.653                
NuGet\Install-Package Redpoint.CommandLine -Version 2024.1320.653                
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="Redpoint.CommandLine" Version="2024.1320.653" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Redpoint.CommandLine --version 2024.1320.653                
#r "nuget: Redpoint.CommandLine, 2024.1320.653"                
#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 Redpoint.CommandLine as a Cake Addin
#addin nuget:?package=Redpoint.CommandLine&version=2024.1320.653

// Install Redpoint.CommandLine as a Cake Tool
#tool nuget:?package=Redpoint.CommandLine&version=2024.1320.653                

Redpoint.CommandLine

This library provides APIs for building dependency injected console applications, with both commands and option declarations being dependency injected.

To use this library, first define your command:

internal class SomeAction
{
	public class Options
	{
		public Option<string> SomeOpt = new Option<string>("--opt", "My option description.");

		// Add more fields or properties that use Option<> or Argument<> and they'll be automatically
		// registered to the command line parser.
	}

	public static Command CreateCommand(ICommandBuilder builder)
	{
		return new Command("some-action", "The description of your some-action command.");
	}

	public class CommandInstance : ICommandInstance
	{
        private readonly ILogger<CommandInstance> _logger;
        private readonly Options _options;

        public CommandInstance(
            ILogger<CommandInstance> logger,
            Options options)
        {
            _logger = logger;
            _options = options;
        }

        public Task<int> ExecuteAsync(ICommandInvocationContext context)
        {
            // Example on how to access an option's value.
            var value = context.ParseResult.GetValueForOption(_options.SomeOpt);

            // ... implement your command here ...
            _logger.LogInformation("Hello world!");

            // Return the exit code for the application.
            return Task.FromResult(0);
        }
	}
}

To register and execute commands, in your Program.Main:

// Use the command line builder APIs to build the root command.
var rootCommand = CommandLineBuilder.NewBuilder()
    .AddGlobalRuntimeServices((builder, services) =>
    {
        // Register global runtime services here, such as services.AddLogging(...)
    })
    .SetGlobalExecutionHandler(async (sp, executeCommand) =>
    {
        // Can be used to wrap execution of all commands, such as capturing
        // exceptions and logging them:

        var logger = sp.GetRequiredService<ILogger<Program>>();
        try
        {
            return await executeCommand().ConfigureAwait(true);
        }
        catch (Exception ex)
        {
            logger.LogError(ex, $"Uncaught exception during command execution: {ex}");
            return 1;
        }
    })
    // Add each of your commands like this:
    .AddCommand<SomeAction.CommandInstance, SomeAction.Options>(SomeAction.CreateCommand)
    // Then build the root command to use below.
    .Build("My console application description.");

// Parse and execute the command.
var exitCode = await rootCommand.InvokeAsync(args).ConfigureAwait(false);
await Console.Out.FlushAsync().ConfigureAwait(false);
await Console.Error.FlushAsync().ConfigureAwait(false);
Environment.Exit(exitCode);
throw new BadImageFormatException();
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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
2025.1018.374 16 17 hours ago
2025.1018.285 22 18 hours ago
2025.1017.646 35 2 days ago
2025.1017.379 34 2 days ago
2025.1016.1370 38 2 days ago
2025.1016.765 36 2 days ago
2025.1016.712 37 2 days ago
2025.1016.550 35 3 days ago
2025.1016.541 35 3 days ago
2025.1016.532 41 3 days ago
2025.1016.325 28 3 days ago
2025.1016.308 34 3 days ago
2025.1016.296 30 3 days ago
2025.1016.237 36 3 days ago
2025.1016.184 36 3 days ago
2025.1016.70 35 3 days ago
2025.1016.6 34 3 days ago
2025.1015.1438 35 3 days ago
2025.1015.1437 33 3 days ago
2025.1015.1411 33 3 days ago
2025.1015.240 35 4 days ago
2025.1015.223 32 4 days ago
2025.1015.183 33 4 days ago
2025.1014.1342 34 4 days ago
2025.1014.273 48 5 days ago
2025.1014.256 51 5 days ago
2025.1012.440 61 7 days ago
2025.1012.327 55 7 days ago
2025.1012.279 55 7 days ago
2025.1002.636 85 17 days ago
2025.1001.1435 81 17 days ago
2025.1001.1397 80 17 days ago
2025.1001.770 90 17 days ago
2025.1001.570 92 18 days ago
2025.1001.558 83 18 days ago
2025.1001.421 92 18 days ago
2025.1001.390 85 18 days ago
2025.1001.234 97 18 days ago
2025.1001.123 87 18 days ago
2024.1360.354 75 25 days ago
2024.1360.60 78 25 days ago
2024.1360.32 80 25 days ago
2024.1358.450 87 a month ago
2024.1358.359 79 a month ago
2024.1358.312 84 a month ago
2024.1358.244 80 a month ago
2024.1358.120 88 a month ago
2024.1348.253 83 a month ago
2024.1345.1379 79 a month ago
2024.1345.506 82 a month ago
2024.1345.379 76 a month ago
2024.1345.145 77 a month ago
2024.1345.72 82 a month ago
2024.1345.69 73 a month ago
2024.1345.15 80 a month ago
2024.1344.1436 81 a month ago
2024.1344.600 90 a month ago
2024.1344.411 78 a month ago
2024.1340.379 89 a month ago
2024.1340.15 90 a month ago
2024.1338.786 85 2 months ago
2024.1338.722 94 2 months ago
2024.1338.697 87 2 months ago
2024.1338.639 89 2 months ago
2024.1338.541 88 2 months ago
2024.1338.318 78 2 months ago
2024.1338.298 83 2 months ago
2024.1338.98 93 2 months ago
2024.1337.756 88 2 months ago
2024.1337.634 87 2 months ago
2024.1337.625 87 2 months ago
2024.1337.621 90 2 months ago
2024.1337.594 84 2 months ago
2024.1337.136 70 2 months ago
2024.1336.793 89 2 months ago
2024.1336.773 88 2 months ago
2024.1336.305 86 2 months ago
2024.1336.12 93 2 months ago
2024.1335.1421 87 2 months ago
2024.1335.1384 85 2 months ago
2024.1334.1308 83 2 months ago
2024.1334.764 87 2 months ago
2024.1334.722 88 2 months ago
2024.1330.185 86 2 months ago
2024.1328.505 87 2 months ago
2024.1328.470 88 2 months ago
2024.1328.452 87 2 months ago
2024.1323.910 87 2 months ago
2024.1323.653 80 2 months ago
2024.1323.185 89 2 months ago
2024.1323.49 80 2 months ago
2024.1322.714 90 2 months ago
2024.1320.653 86 2 months ago
2024.1320.619 78 2 months ago
2024.1320.601 88 2 months ago
2024.1320.159 84 2 months ago
2024.1320.98 81 2 months ago
2024.1320.2 82 2 months ago
2024.1319.1431 83 2 months ago
2024.1319.1335 82 2 months ago
2024.1317.631 89 2 months ago
2024.1316.330 104 2 months ago
2024.1311.540 97 2 months ago
2024.1306.225 91 3 months ago
2024.1306.199 91 3 months ago
2024.1306.171 87 3 months ago
2024.1306.117 85 3 months ago
2024.1305.506 83 3 months ago
2024.1305.502 93 3 months ago
2024.1305.465 88 3 months ago
2024.1305.442 82 3 months ago
2024.1305.399 90 3 months ago
2024.1299.1070 84 3 months ago
2024.1289.621 91 3 months ago
2024.1289.338 89 3 months ago
2024.1277.836 94 3 months ago
2024.1277.711 88 4 months ago
2024.1277.695 89 4 months ago
2024.1270.409 97 4 months ago
2024.1269.621 115 4 months ago
2024.1269.619 99 4 months ago
2024.1269.605 101 4 months ago
2024.1242.282 110 5 months ago
2024.1242.261 91 5 months ago
2024.1242.233 111 5 months ago
2024.1238.829 110 5 months ago
2024.1238.327 127 5 months ago
2024.1225.297 122 5 months ago
2024.1205.140 78 6 months ago
2024.1204.110 113 6 months ago
2024.1204.62 79 6 months ago
2024.1190.491 111 6 months ago
2024.1177.305 116 7 months ago
2024.1168.700 96 7 months ago
2024.1168.649 111 7 months ago
2024.1168.535 98 7 months ago
2024.1167.643 103 7 months ago
2024.1166.989 116 7 months ago
2024.1166.818 90 7 months ago
2024.1166.535 93 7 months ago
2024.1166.422 109 7 months ago
2024.1166.362 95 7 months ago
2024.1166.360 95 7 months ago
2024.1165.1212 100 7 months ago
2024.1165.1160 88 7 months ago
2024.1165.1019 103 7 months ago
2024.1165.978 109 7 months ago
2024.1165.920 104 7 months ago
2024.1165.908 91 7 months ago
2024.1165.873 90 7 months ago
2024.1165.830 113 7 months ago
2024.1165.806 114 7 months ago
2024.1165.794 91 7 months ago
2024.1165.792 105 7 months ago
2024.1165.761 104 7 months ago
2024.1165.743 105 7 months ago
2024.1165.735 89 7 months ago
2024.1165.713 113 7 months ago
2024.1165.640 94 7 months ago
2024.1165.574 107 7 months ago
2024.1165.466 105 7 months ago
2024.1165.417 119 7 months ago
2024.1165.392 107 7 months ago
2024.1164.341 83 7 months ago
2024.1155.941 116 8 months ago
2024.1140.783 116 8 months ago
2024.1140.692 112 8 months ago
2024.1140.673 95 8 months ago
2024.1129.506 119 8 months ago
2024.1128.831 135 8 months ago
2024.1124.465 89 9 months ago
2024.1123.1162 82 9 months ago
2024.1123.1117 67 9 months ago
2024.1123.1050 76 9 months ago
2024.1122.352 117 9 months ago
2024.1122.233 102 9 months ago
2024.1115.1101 125 9 months ago
2024.1115.1048 101 9 months ago
2024.1115.932 105 9 months ago
2024.1115.858 97 9 months ago
2024.1115.665 106 9 months ago
2024.1115.648 125 9 months ago
2024.1115.591 97 9 months ago
2024.1101.390 104 9 months ago
2024.1100.741 123 9 months ago
2024.1099.526 102 9 months ago
2024.1099.466 107 9 months ago
2024.1098.573 124 9 months ago
2024.1095.977 104 9 months ago
2024.1095.847 99 9 months ago
2024.1095.604 106 9 months ago
2024.1095.485 120 9 months ago
2024.1094.930 101 10 months ago
2024.1094.910 117 10 months ago
2024.1094.387 117 10 months ago
2024.1094.313 117 10 months ago
2024.1093.520 114 10 months ago
2024.1092.240 108 10 months ago
2024.1089.1425 120 10 months ago
2024.1089.983 106 10 months ago
2024.1089.942 99 10 months ago
2024.1089.2 102 10 months ago
2024.1088.1343 129 10 months ago
2024.1088.1139 121 10 months ago
2024.1088.875 116 10 months ago
2024.1088.700 134 10 months ago
2024.1088.603 123 10 months ago
2024.1088.590 94 10 months ago
2024.1088.575 125 10 months ago
2024.1088.561 127 10 months ago
2024.1088.506 104 10 months ago
2024.1088.18 105 10 months ago
2024.1087.1181 136 10 months ago
2024.1087.1173 104 10 months ago
2024.1087.1143 124 10 months ago
2024.1087.1108 110 10 months ago
2024.1087.950 141 10 months ago
2024.1087.939 115 10 months ago
2024.1087.252 117 10 months ago
2024.1070.736 137 3/10/2024
2024.1049.1437 144 2/19/2024
2024.1036.571 135 2/5/2024
2024.1036.508 99 2/5/2024
2024.1032.1204 110 2/1/2024
2024.1032.1133 99 2/1/2024
2024.1032.1122 114 2/1/2024
2024.1032.1071 95 2/1/2024
2024.1032.940 116 2/1/2024
2024.1031.912 113 1/31/2024
2024.1031.893 95 1/31/2024
2024.1031.851 114 1/31/2024
2024.1031.829 109 1/31/2024
2024.1031.386 124 1/31/2024
2024.1031.318 119 1/31/2024
2024.1017.460 127 1/17/2024
2024.1017.420 113 1/17/2024
2024.1017.163 115 1/17/2024
2024.1016.414 318 1/16/2024
2024.1012.167 134 1/12/2024
2024.1011.406 117 1/11/2024
2024.1010.315 124 1/10/2024
2023.1358.326 155 12/24/2023
2023.1351.473 143 12/17/2023
2023.1351.445 114 12/17/2023
2023.1351.432 127 12/17/2023
2023.1350.478 116 12/16/2023
2023.1344.600 124 12/10/2023
2023.1344.529 134 12/10/2023
2023.1339.582 162 12/5/2023
2023.1338.1072 134 12/4/2023
2023.1336.844 137 12/2/2023
2023.1335.378 143 12/1/2023
2023.1335.236 140 12/1/2023
2023.1335.203 136 12/1/2023
2023.1334.814 130 11/30/2023
2023.1332.652 126 11/28/2023
2023.1332.622 139 11/28/2023
2023.1332.524 156 11/28/2023
2023.1331.1073 117 11/27/2023
2023.1331.423 126 11/27/2023
2023.1328.513 137 11/24/2023
2023.1327.985 145 11/23/2023
2023.1325.593 137 11/21/2023
2023.1325.551 140 11/21/2023
2023.1325.529 130 11/21/2023