Skip to content

Commit 7216a37

Browse files
committed
renamed some interfaces and attributes. introduces the CommandOrderAttribute.
1 parent dd164d2 commit 7216a37

File tree

40 files changed

+156
-117
lines changed

40 files changed

+156
-117
lines changed

sources/ConsoleTools.Commando.Demo.Autofac.Builder/Commands/DefaultCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
namespace DustInTheWind.ConsoleTools.Commando.Demo.Autofac.Builder.Commands;
1818

19-
[Command(Order = 100, Description = "Default command to be executed when no command name is specified.")]
20-
public class DefaultCommand : CommandBase
19+
[AnonymousCommand(Description = "Default command to be executed when no command name is specified.")]
20+
public class DefaultCommand : ConsoleCommandBase
2121
{
2222
[NamedParameter("text")]
2323
public string Text { get; set; }

sources/ConsoleTools.Commando.Demo.Autofac.Builder/Commands/DummyCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
namespace DustInTheWind.ConsoleTools.Commando.Demo.Autofac.Builder.Commands;
1818

1919
[NamedCommand("dummy", Description = "A dummy command that shows how to create parameters of different types.")]
20-
public class DummyCommand : CommandBase
20+
public class DummyCommand : ConsoleCommandBase
2121
{
2222
[NamedParameter("text", ShortName = 't', IsOptional = true, Description = "A simple text.")]
2323
public string Text { get; set; }

sources/ConsoleTools.Commando.Demo.Autofac.Builder/Commands/DummyView.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ namespace DustInTheWind.ConsoleTools.Commando.Demo.Autofac.Builder.Commands;
1818

1919
public class DummyView : ViewBase<DummyCommand>
2020
{
21-
public override void Display(DummyCommand command)
21+
public override void Display(DummyCommand dummyCommand)
2222
{
2323
WithIndentation("Same values after command finished execution:", () =>
2424
{
25-
WriteValue("Text", command.Text);
26-
WriteValue("Flag", command.Flag);
27-
WriteValue("Integer Number", command.IntegerNumber);
28-
WriteValue("Real Number", command.RealNumber);
29-
WriteValue("Character", command.Character);
30-
WriteValue("Param 1", command.Param1);
31-
WriteValue("Param 2", command.Param2);
25+
WriteValue("Text", dummyCommand.Text);
26+
WriteValue("Flag", dummyCommand.Flag);
27+
WriteValue("Integer Number", dummyCommand.IntegerNumber);
28+
WriteValue("Real Number", dummyCommand.RealNumber);
29+
WriteValue("Character", dummyCommand.Character);
30+
WriteValue("Param 1", dummyCommand.Param1);
31+
WriteValue("Param 2", dummyCommand.Param2);
3232
});
3333
}
3434
}

sources/ConsoleTools.Commando.Demo.Autofac.Builder/Commands/ReadFileCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
namespace DustInTheWind.ConsoleTools.Commando.Demo.Autofac.Builder.Commands;
2020

2121
[NamedCommand("read", Description = "Display the content of a text file.")]
22-
public class ReadFileCommand : CommandBase
22+
public class ReadFileCommand : ConsoleCommandBase
2323
{
2424
[AnonymousParameter(Order = 1, Description = "The path to the file that should be displayed.")]
2525
public string FilePath { get; set; }

sources/ConsoleTools.Commando.Demo.Autofac.Builder/Properties/launchSettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"profiles": {
33
"ConsoleTools.Commando.Demo": {
44
"commandName": "Project",
5-
"commandLineArgs": "read -e UTF-16 c:\\temp\\VPNConfig.ovpn"
5+
"commandLineArgs": "help"
66
}
77
}
88
}

sources/ConsoleTools.Commando.Demo.Autofac.DependencyInjection/Commands/DefaultCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
namespace DustInTheWind.ConsoleTools.Commando.Demo.Autofac.DependencyInjection.Commands;
1818

19-
[Command(Order = 100, Description = "Default command to be executed when no command name is specified.")]
20-
public class DefaultCommand : CommandBase
19+
[AnonymousCommand(Description = "Default command to be executed when no command name is specified.")]
20+
public class DefaultCommand : ConsoleCommandBase
2121
{
2222
[NamedParameter("text")]
2323
public string Text { get; set; }

sources/ConsoleTools.Commando.Demo.Autofac.DependencyInjection/Commands/DummyCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
namespace DustInTheWind.ConsoleTools.Commando.Demo.Autofac.DependencyInjection.Commands;
1818

1919
[NamedCommand("dummy", Description = "A dummy command that shows how to create parameters of different types.")]
20-
public class DummyCommand : CommandBase
20+
public class DummyCommand : ConsoleCommandBase
2121
{
2222
[NamedParameter("text", ShortName = 't', IsOptional = true, Description = "A simple text.")]
2323
public string Text { get; set; }

sources/ConsoleTools.Commando.Demo.Autofac.DependencyInjection/Commands/ReadFileCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
namespace DustInTheWind.ConsoleTools.Commando.Demo.Autofac.DependencyInjection.Commands;
1818

1919
[NamedCommand("read", Description = "Display the content of a text file.")]
20-
public class ReadFileCommand : CommandBase
20+
public class ReadFileCommand : ConsoleCommandBase
2121
{
2222
[AnonymousParameter(Order = 1, Description = "The path to the file that should be displayed.")]
2323
public string FilePath { get; set; }

sources/ConsoleTools.Commando.Demo.Microsoft.Builder/Commands/DefaultCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
namespace DustInTheWind.ConsoleTools.Commando.Demo.Microsoft.Builder.Commands;
1818

19-
[Command(Order = 100, Description = "Default command to be executed when no command name is specified.")]
20-
public class DefaultCommand : CommandBase
19+
[AnonymousCommand(Description = "Default command to be executed when no command name is specified.")]
20+
public class DefaultCommand : ConsoleCommandBase
2121
{
2222
[NamedParameter("text")]
2323
public string Text { get; set; }

sources/ConsoleTools.Commando.Demo.Microsoft.Builder/Commands/DummyCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
namespace DustInTheWind.ConsoleTools.Commando.Demo.Microsoft.Builder.Commands;
1818

1919
[NamedCommand("dummy", Description = "A dummy command that shows how to create parameters of different types.")]
20-
public class DummyCommand : CommandBase
20+
public class DummyCommand : ConsoleCommandBase
2121
{
2222
[NamedParameter("text", ShortName = 't', IsOptional = true, Description = "A simple text.")]
2323
public string Text { get; set; }

0 commit comments

Comments
 (0)