Skip to content

Aliasadidev add support for custom args#70

Merged
alirezanet merged 3 commits intoalirezanet:masterfrom
aliasadidev:aliasadidev-add-support-for-custom-args
Apr 17, 2023
Merged

Aliasadidev add support for custom args#70
alirezanet merged 3 commits intoalirezanet:masterfrom
aliasadidev:aliasadidev-add-support-for-custom-args

Conversation

@aliasadidev
Copy link
Copy Markdown
Contributor

Description

Currently, there is no option on ArgumentParser class to create an ArgumentInfo that supports both AddCustomArgument and AddStaticArgument in one Args, I added this option.

 {
      "name": "Run JB Clean Up Code",
      "command": "cmd",
      "pathMode": "relative",
      "args": [
        "/c",
        "dotnet",
        "jb",
        "cleanupcode",
        "proj.sln",
        "--profile=Team: Full Cleanup",
        "--include=${args}" <======= added for this usage.
      ],
      "group": "pre-commit"
    }
switch (arg.ToLower().Trim())
{
 case "${args}":
    AddCustomArguments(args, optionArguments);
    break;
 case var value when value.Contains("${args}") && optionArguments is not null && optionArguments.Any():
   args.Add(new ArgumentInfo(ArgumentTypes.Static, value.Replace("${args}", string.Join(' ', optionArguments!))));
   break;
 case "${last-commit}":
//...

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist

  • I have performed a self-review of my code
  • I have added tests that prove my fix is effective or that my feature works
  • I have made corresponding changes to the documentation
  • I have commented my code, particularly in hard-to-understand areas
  • New and existing unit tests pass locally with my changes
  • I did test corresponding changes on Windows
  • I did test corresponding changes on Linux
  • I did test corresponding changes on Mac

Copy link
Copy Markdown
Owner

@alirezanet alirezanet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @aliasadidev,
Nice 🚀💐, just a small change request in documentation.

@alirezanet alirezanet added the Test Need manual test or some unit test label Apr 17, 2023
@aliasadidev
Copy link
Copy Markdown
Contributor Author

@alirezanet Hi,
Please let me know when you publish it on Nuget, I want to use that on the pipeline.
Thanks. :)

@alirezanet alirezanet merged commit d28c58b into alirezanet:master Apr 17, 2023
@alirezanet alirezanet removed the Test Need manual test or some unit test label Apr 17, 2023
@alirezanet
Copy link
Copy Markdown
Owner

@alirezanet Hi, Please let me know when you publish it on Nuget, I want to use that on the pipeline. Thanks. :)

It is available in 0.6.0-Preview2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants