Skip to content

Commit 561751f

Browse files
committed
Minor code cleanup
1 parent fb0f246 commit 561751f

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/XenoAtom.CommandLine/Command.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace XenoAtom.CommandLine;
1717
/// <summary>
1818
/// This class represents a command that can be executed. It can contain sub-commands, options and argument sources.
1919
/// </summary>
20-
public partial class Command : CommandContainer, ICommandNodeDescriptor
20+
public class Command : CommandContainer, ICommandNodeDescriptor
2121
{
2222
private readonly Dictionary<string, Command> _subCommands = new();
2323
private readonly Dictionary<string, Option> _options = new();
@@ -201,13 +201,10 @@ public virtual async ValueTask<int> RunAsync(IEnumerable<string> arguments, Comm
201201
if (commandContext.ShouldShowLicenseOnRun)
202202
{
203203
var appCommand = GetCommandApp();
204-
if (appCommand != null)
204+
var licenseHeader = appCommand?.LicenseHeader;
205+
if (licenseHeader != null)
205206
{
206-
var licenseHeader = appCommand.LicenseHeader;
207-
if (licenseHeader != null)
208-
{
209-
runConfig.Out.WriteLine(licenseHeader());
210-
}
207+
runConfig.Out.WriteLine(licenseHeader());
211208
}
212209
}
213210
return await Action.Invoke(commandContext, extra.ToArray());

0 commit comments

Comments
 (0)