{"id":15066145,"url":"https://github.com/specstet/consoleappwitharguments","last_synced_at":"2026-02-14T02:02:01.594Z","repository":{"id":222472532,"uuid":"757342052","full_name":"SPECSTET/ConsoleAppWithArguments","owner":"SPECSTET","description":"Basic template for a console application with start arguments","archived":false,"fork":false,"pushed_at":"2024-02-14T11:48:32.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-15T08:42:06.059Z","etag":null,"topics":["arguments","console-app","console-application","dotnet","dotnet-core","dotnet8","dotnetcore","parameters"],"latest_commit_sha":null,"homepage":"https://www.specstet.com/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SPECSTET.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-14T09:51:34.000Z","updated_at":"2024-02-14T11:43:33.000Z","dependencies_parsed_at":"2024-02-14T12:55:18.368Z","dependency_job_id":null,"html_url":"https://github.com/SPECSTET/ConsoleAppWithArguments","commit_stats":null,"previous_names":["specstet/consoleappwitharguments"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SPECSTET/ConsoleAppWithArguments","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SPECSTET%2FConsoleAppWithArguments","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SPECSTET%2FConsoleAppWithArguments/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SPECSTET%2FConsoleAppWithArguments/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SPECSTET%2FConsoleAppWithArguments/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SPECSTET","download_url":"https://codeload.github.com/SPECSTET/ConsoleAppWithArguments/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SPECSTET%2FConsoleAppWithArguments/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29431593,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T22:20:51.549Z","status":"online","status_checked_at":"2026-02-14T02:00:07.626Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["arguments","console-app","console-application","dotnet","dotnet-core","dotnet8","dotnetcore","parameters"],"created_at":"2024-09-25T01:02:20.575Z","updated_at":"2026-02-14T02:02:01.575Z","avatar_url":"https://github.com/SPECSTET.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Console app with arguments or env variables\n\n\u003e Template for a C# console application that can be started with arguments or environment variables.\n\u003e It can be provided with default values or with an error message if the value is not set as a parameter or as an environment variable.\n\n\u003e Vorlage für eine C# Konsolen Applikation, die mit Argumenten oder mit Umgebungsvariablen gestartet werden kann.\n\u003e Sie kann mit Defaultwerten versehen werden oder mit einer Fehlermeldung, wenn der Wert nicht als Parameter oder als Umgebungsvariable gesetzt ist.\n\n\u003e Шаблон для консольного приложения на C#, которое можно запускать с помощью аргументов или переменных окружения.\n\u003e Он может иметь значения по умолчанию или сообщение об ошибке, если значение не задано в качестве параметра или переменной окружения.\n\nThe template is based on [System.CommandLine](https://www.nuget.org/packages/System.CommandLine) from Microsoft.\n\n```csharp\nusing System.CommandLine;\n\nvar prefix = \"TRXPARSER\";\n\n// Title with default value as string\nvar title = new Option\u003cstring\u003e\n    (name: \"--title\",\n    description: \"The title of the test run\",\n    getDefaultValue: () =\u003e Environment.GetEnvironmentVariable($\"{prefix}_TITLE\") ?? \"Title argument not set!\");\n\n// Searchpath with exception when not set\nvar searchpath = new Option\u003cstring\u003e\n    (name: \"--searchpath\",\n    description: \"File path to search the TRX files\",\n    getDefaultValue: () =\u003e Environment.GetEnvironmentVariable($\"{prefix}_SEARCHPATH\") ?? throw new Exception(\"\\n\\n=\u003eSearch path for TRX files not set!\\n\"));\n\n// OKLimit with default value as int\nvar oklimit = new Option\u003cint\u003e\n    (name: \"--oklimit\",\n    description: \"Minimum percentage as Int for a test to be marked as OK\",\n    getDefaultValue: () =\u003e int.TryParse(Environment.GetEnvironmentVariable($\"{prefix}_OKLIMIT\"), out int limit) ? limit : 100);\n\nvar rootCommand = new RootCommand\n{\n    title,\n    searchpath,\n    oklimit\n};\n\nrootCommand.SetHandler((title, searchpath, oklimit) =\u003e\n{\n    Console.WriteLine(searchpath);\n    Console.WriteLine(oklimit);\n    Console.WriteLine(title);\n}, title, searchpath, oklimit);\n\nawait rootCommand.InvokeAsync(args);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspecstet%2Fconsoleappwitharguments","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspecstet%2Fconsoleappwitharguments","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspecstet%2Fconsoleappwitharguments/lists"}