Skip to content

Commit b30c6fb

Browse files
committed
Refactor: Replaced CliArgsParser with CliParser and updated usage. Updated version bump commands to include root directory argument.
1 parent a18783d commit b30c6fb

File tree

2 files changed

+15
-18
lines changed

2 files changed

+15
-18
lines changed

src/Tools.CodeOfChaos.Testing.TUnit/Program.cs

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,20 @@ public static class Program {
1212
public static async Task Main(string[] args) {
1313
// Register & Build the parser
1414
// Don't forget to add the current assembly if you built more tools for the current project
15-
CliArgsParser parser = CliArgsBuilder.CreateFromConfig(
16-
config => {
17-
config.AddCommandsFromAssemblyEntrypoint<IAssemblyEntry>();
18-
}
19-
).Build();
15+
ICliParser parser = CliParser.CreateBuilder()
16+
.AddFromAssembly<IAssemblyEntry>()
17+
.Build();
2018

2119
// We are doing this here because else the launchSettings.json file becomes a humongous issue to deal with.
22-
// Sometimes CLI params is not the answer.
23-
// Code is the true saviour
20+
// Sometimes CLI params are not the answer.
21+
// Code is the true savior
2422
string projects = string.Join(";",
25-
"CodeOfChaos.Testing",
26-
"CodeOfChaos.Testing.TUnit"
23+
"InfiniLore.Lucide",
24+
"InfiniLore.Lucide.SourceGenerators"
2725
);
2826

29-
string oneLineArgs = InputHelper.ToOneLine(args).Replace("%PROJECTS%", projects);
30-
31-
// Finally start executing
32-
await parser.ParseAsync(oneLineArgs);
27+
// Finally, start executing
28+
string oneLineArgs = ArgsInputHelper.ToOneLine(args).Replace("%PROJECTS%", projects);
29+
await parser.ExecuteAsync(oneLineArgs);
3330
}
3431
}

src/Tools.CodeOfChaos.Testing.TUnit/Properties/launchSettings.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,27 @@
33
"Version Bump : Major": {
44
"_readme": "will update the 'patch' section of the semantic version (x.0.0)",
55
"commandName": "Project",
6-
"commandLineArgs": "git-version-bump --section=\"major\" --projects=\"%PROJECTS%\" --push"
6+
"commandLineArgs": "git-version-bump --section=\"major\" --projects=\"%PROJECTS%\" --push --root=\"..\\..\\\""
77
},
88
"Version Bump : Minor": {
99
"_readme": "will update the 'patch' section of the semantic version (0.x.0)",
1010
"commandName": "Project",
11-
"commandLineArgs": "git-version-bump --section=\"minor\" --projects=\"%PROJECTS%\" --push"
11+
"commandLineArgs": "git-version-bump --section=\"minor\" --projects=\"%PROJECTS%\" --push --root=\"..\\..\\\""
1212
},
1313
"Version Bump : Patch": {
1414
"_readme": "will update the 'patch' section of the semantic version (0.0.x)",
1515
"commandName": "Project",
16-
"commandLineArgs": "git-version-bump --section=\"patch\" --projects=\"%PROJECTS%\" --push"
16+
"commandLineArgs": "git-version-bump --section=\"patch\" --projects=\"%PROJECTS%\" --push --root=\"..\\..\\\""
1717
},
1818
"Version Bump : Preview": {
1919
"_readme": "will update the 'preview' section of the semantic version (0.0.0-preview.x)",
2020
"commandName": "Project",
21-
"commandLineArgs": "git-version-bump --section=\"preview\" --projects=\"%PROJECTS%\" --push"
21+
"commandLineArgs": "git-version-bump --section=\"preview\" --projects=\"%PROJECTS%\" --push --root=\"..\\..\\\""
2222
},
2323
"Version Bump : Manual": {
2424
"_readme": "useful for setting a preview for an upcoming version. Will ask for a prompt of the new version string",
2525
"commandName": "Project",
26-
"commandLineArgs": "git-version-bump --section=\"manual\" --projects=\"%PROJECTS%\" --push"
26+
"commandLineArgs": "git-version-bump --section=\"manual\" --projects=\"%PROJECTS%\" --push --root=\"..\\..\\\""
2727
},
2828
"Download Icon": {
2929
"_readme": "downloads a png to a specific location to then be used by nuget packages as a built in icon",

0 commit comments

Comments
 (0)