<commit_before>﻿using CommandLine.Attributes;
using CommandLine.Attributes.Advanced;
using CommandLine.Tests;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CommandLine.TestApp
{
    class Program
    {
        static void Main(string[] args)
        {
            args = "a 1 -opt1 3 -opt2 3 -opt3 c -opt4 t".Split(' ');
            var x111 = CommandLine.Parser.Parse<Options1>(args);

            args = new string[] { "-?" };
            var x = CommandLine.Parser.Parse<Groups1>(args);
            Console.WriteLine("----------------");
            var x1 = CommandLine.Parser.Parse<Options1>(args);
            Console.WriteLine("============================");
            args = new string[] { "--help" };
            var y = CommandLine.Parser.Parse<Groups1>(args);
            Console.WriteLine("----------------");
            var y2 = CommandLine.Parser.Parse<Options1>(args);

            args = new string[] { "Command1", "-?" };
            Console.WriteLine("============================");
            var x3 = CommandLine.Parser.Parse<Groups1>(args);

            args = new string[] { "NoCommands", "-?" };
            Console.WriteLine("============================");
            var x4 = CommandLine.Parser.Parse<Groups1>(args);

            args = new string[] { "NoCommands" };
            Console.WriteLine("============================");
            var x44 = CommandLine.Parser.Parse<Groups1>(args);

            args = new string[] { "Command1", };
            Console.WriteLine("============================");
            var x32 = CommandLine.Parser.Parse<Groups1>(args);

            args = new string[] { "--help" };
            Console.WriteLine("============================");
            var x5 = CommandLine.Parser.Parse<Groups1>(args);
            Console.WriteLine("----------------");
            var y4 = CommandLine.Parser.Parse<Options1>(args);


            args = new string[] { };
            Console.WriteLine("============================");
            var x55 = CommandLine.Parser.Parse<Groups1>(args);

            Console.WriteLine("----------------");
            var y455 = CommandLine.Parser.Parse<Options1>(args);
        }
    }

    internal enum Command
    {
        Command1,
        Command2,
        NoCommands
    }
    internal class Groups1
    {
        [ActionArgument]
        public Command Command { get; set; }

        [ArgumentGroup(nameof(Command.Command1))]
        [ArgumentGroup(nameof(Command.Command2))]
        [RequiredArgument(0, "p1", "Required parameter 1")]
        public string p1 { get; set; }

        [ArgumentGroup(nameof(Command.Command1))]
        [OptionalArgument(256, "opt1", "Optional parameter 1")]
        public int opt1 { get; set; }

        [ArgumentGroup(nameof(Command.Command2))]
        [RequiredArgument(1, "p2", "Required parameter 1")]
        public string p2 { get; set; }

        [ArgumentGroup(nameof(Command.Command2))]
        [RequiredArgument(2, "p21212", "Required parameter 1")]
        public string p3 { get; set; }

        [ArgumentGroup(nameof(Command.Command2))]<commit_msg>The enum that describes a Command is now sorted by its value.<commit_after>﻿using CommandLine.Attributes;
using CommandLine.Attributes.Advanced;
using CommandLine.Tests;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CommandLine.TestApp
{
    class Program
    {
        static void Main(string[] args)
        {
            args = "a 1 -opt1 3 -opt2 3 -opt3 c -opt4 t".Split(' ');
            var x111 = CommandLine.Parser.Parse<Options1>(args);

            args = new string[] { "-?" };
            var x = CommandLine.Parser.Parse<Groups1>(args);
            Console.WriteLine("----------------");
            var x1 = CommandLine.Parser.Parse<Options1>(args);
            Console.WriteLine("============================");
            args = new string[] { "--help" };
            var y = CommandLine.Parser.Parse<Groups1>(args);
            Console.WriteLine("----------------");
            var y2 = CommandLine.Parser.Parse<Options1>(args);

            args = new string[] { "Command1", "-?" };
            Console.WriteLine("============================");
            var x3 = CommandLine.Parser.Parse<Groups1>(args);

            args = new string[] { "NoCommands", "-?" };
            Console.WriteLine("============================");
            var x4 = CommandLine.Parser.Parse<Groups1>(args);

            args = new string[] { "NoCommands" };
            Console.WriteLine("============================");
            var x44 = CommandLine.Parser.Parse<Groups1>(args);

            args = new string[] { "Command1", };
            Console.WriteLine("============================");
            var x32 = CommandLine.Parser.Parse<Groups1>(args);

            args = new string[] { "--help" };
            Console.WriteLine("============================");
            var x5 = CommandLine.Parser.Parse<Groups1>(args);
            Console.WriteLine("----------------");
            var y4 = CommandLine.Parser.Parse<Options1>(args);


            args = new string[] { };
            Console.WriteLine("============================");
            var x55 = CommandLine.Parser.Parse<Groups1>(args);

            Console.WriteLine("----------------");
            var y455 = CommandLine.Parser.Parse<Options1>(args);
        }
    }

    internal enum Command
    {
        Command2 = 2,
        Command1 = 1,
        NoCommands = 3
    }
    internal class Groups1
    {
        [ActionArgument]
        public Command Command { get; set; }

        [ArgumentGroup(nameof(Command.Command1))]
        [ArgumentGroup(nameof(Command.Command2))]
        [RequiredArgument(0, "p1", "Required parameter 1")]
        public string p1 { get; set; }

        [ArgumentGroup(nameof(Command.Command1))]
        [OptionalArgument(256, "opt1", "Optional parameter 1")]
        public int opt1 { get; set; }

        [ArgumentGroup(nameof(Command.Command2))]
        [RequiredArgument(1, "p2", "Required parameter 1")]
        public string p2 { get; set; }

        [ArgumentGroup(nameof(Command.Command2))]
        [RequiredArgument(2, "p21212", "Required parameter 1")]
        public string p3 { get; set; }

        [ArgumentGroup(nameof(Command.Command2))]
{'fraction_non_alphanumeric': 0.20690728064716865, 'fraction_numerical': 0.02255756067205974, 'mean_word_length': 2.2322775263951735, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4720022', 'n_tokens_mistral': 1708, 'n_tokens_neox': 1650, 'n_words': 365}