{"id":21528275,"url":"https://github.com/masesgroup/cliparser","last_synced_at":"2025-04-09T23:42:23.601Z","repository":{"id":42435364,"uuid":"401146160","full_name":"masesgroup/CLIParser","owner":"masesgroup","description":"A library to manage command-line arguments in a simple way.","archived":false,"fork":false,"pushed_at":"2024-10-07T05:07:47.000Z","size":17646,"stargazers_count":1,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-01T11:51:30.485Z","etag":null,"topics":["cli","command-line","command-line-tool","dotnet","dotnet-core","dotnet-framework","dotnet6","dotnetcore","net6","netstandard","netstandard20","parser"],"latest_commit_sha":null,"homepage":"https://cliparser.masesgroup.com/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/masesgroup.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"masesgroup","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2021-08-29T21:30:14.000Z","updated_at":"2024-10-08T08:41:38.000Z","dependencies_parsed_at":"2024-11-24T02:15:23.564Z","dependency_job_id":null,"html_url":"https://github.com/masesgroup/CLIParser","commit_stats":{"total_commits":40,"total_committers":4,"mean_commits":10.0,"dds":0.6,"last_synced_commit":"d6dcddf4f38d417ccb9a0eda14aac0d954ccbfd5"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masesgroup%2FCLIParser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masesgroup%2FCLIParser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masesgroup%2FCLIParser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masesgroup%2FCLIParser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/masesgroup","download_url":"https://codeload.github.com/masesgroup/CLIParser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248131470,"owners_count":21052819,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","command-line","command-line-tool","dotnet","dotnet-core","dotnet-framework","dotnet6","dotnetcore","net6","netstandard","netstandard20","parser"],"created_at":"2024-11-24T01:52:28.130Z","updated_at":"2025-04-09T23:42:23.584Z","avatar_url":"https://github.com/masesgroup.png","language":"C#","funding_links":["https://github.com/sponsors/masesgroup"],"categories":[],"sub_categories":[],"readme":"# CLI Parser\n\n[![CI_BUILD](https://github.com/masesgroup/CLIParser/actions/workflows/build.yaml/badge.svg)](https://github.com/masesgroup/CLIParser/actions/workflows/build.yaml) [![CI_RELEASE](https://github.com/masesgroup/CLIParser/actions/workflows/release.yaml/badge.svg)](https://github.com/masesgroup/CLIParser/actions/workflows/release.yaml)\n\n|CLIParser |\n|---\t|\n|[![CLIParser nuget](https://img.shields.io/nuget/v/MASES.CLIParser)](https://www.nuget.org/packages/MASES.CLIParser) [![downloads](https://img.shields.io/nuget/dt/MASES.CLIParser)](https://www.nuget.org/packages/MASES.CLIParser) |\n\nA library to manage command-line arguments in a simple way. It was an internal MASES project, now it is available to anyone.\n\nThis project adheres to the Contributor [Covenant code of conduct](https://github.com/masesgroup/DataDistributionManager/blob/master/CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to coc_reporting@masesgroup.com.\n\n## How it works\n\nThe library is very simple in its usage. The definition of command-line switches is based on generic C# types. The parser fully analyze the command line searching for switches and arguments. A special case is the one where the swithes can be inserted within an external file listing the switches line-by-line.\nTo see a real application of the library look at project [JCOReflectorCLI](https://github.com/masesgroup/JCOReflector/tree/master/JCOReflector/CLI) and [JCOReflectorEngine](https://github.com/masesgroup/JCOReflector/blob/master/JCOReflector/engine/SharedClasses.cs)\n\n### Argument definition\n\nAn argument can be defined using the following syntax sinppets:\n\n```C#\narg = new ArgumentMetadata\u003cbool\u003e()\n{\n\tName = \"test\",\n\tShortName = \"tst\",\n\tHelp = \"this is a test\",\n\tType = ArgumentType.Double,\n\tValueType = ArgumentValueType.Free,\n}\n\narg1 = new ArgumentMetadata\u003cint\u003e()\n{\n\tName = \"range\",\n\tDefault = 9,\n\tType = ArgumentType.Double,\n\tValueType = ArgumentValueType.Range,\n\tMinValue = 2,\n\tMaxValue = 10,\n}\n```\n\n### Parser initialization\n\nUpon arguments are defined they can be added to the list managed from the parser using:\n\n```C#\nParser.Add(arg);\n```\n\nor the compact version:\n\n```C#\narg1.Add();\n```\n\n### Parser use\n\nThen it is possible to use the parser on command-line arguments:\n\n```C#\nParser.Parse(args);\n```\n\nor the compact version:\n\n```C#\nargs.Parse();\n```\n\n### Argument check\n\nWhen the `Parse` method returns, a list of prepared arguments is available. The list can be used to get value or check for existence.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmasesgroup%2Fcliparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmasesgroup%2Fcliparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmasesgroup%2Fcliparser/lists"}