Skip to content

Commit 9d95953

Browse files
sunnamed434claude
andcommitted
feat(cli): add --nologo flag to suppress the startup logo banner
Mirrors the well-known dotnet/MSBuild --nologo convention. Threaded through Options -> ObfuscationNeeds and gated in both the CLI and GlobalTool entry points (shared Modules cover both). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 8f3e4e9 commit 9d95953

6 files changed

Lines changed: 16 additions & 2 deletions

File tree

docs/source/usage/how-to-use.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Available options:
4242
- ``--obfuscation-file``: Custom obfuscation config file
4343
- ``-n, --output-name``: Custom output file name (default: same as input)
4444
- ``--no-watermark``: Turn off watermarking
45+
- ``--nologo``: Don't show the BitMono logo banner on startup (same idea as ``dotnet --nologo``)
4546
- ``--strong-name-key``: Path to strong name key (.snk) file for assembly signing
4647

4748
Setup

src/BitMono.CLI/Modules/ObfuscationNeeds.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ internal class ObfuscationNeeds
2020
public string? InspectMetadataPath { get; set; }
2121
// Set when the run is a standalone --encrypt-metadata step instead of an obfuscation. See #276.
2222
public string? EncryptMetadataPath { get; set; }
23+
// CLI --nologo: suppress the ASCII banner on startup.
24+
public bool NoLogo { get; set; }
2325
#pragma warning restore CS8618
2426
}
2527

src/BitMono.CLI/Modules/Options.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ internal class Options
3434
[Option("no-watermark", Required = false, HelpText = "Disable watermarking (overrides obfuscation.json setting).")]
3535
public bool NoWatermark { get; set; }
3636

37+
[Option("nologo", Required = false, HelpText = "Don't display the BitMono logo (ASCII banner) on startup. Mirrors the dotnet/MSBuild --nologo convention.")]
38+
public bool NoLogo { get; set; }
39+
3740
[Option("strong-name-key", Required = false, HelpText = "Path to strong name key (.snk) file for assembly signing.")]
3841
public string? StrongNameKey { get; set; }
3942

src/BitMono.CLI/Modules/OptionsObfuscationNeedsFactory.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ public OptionsObfuscationNeedsFactory(string[] args)
195195
};
196196
}
197197

198+
needs.NoLogo = options.NoLogo;
199+
198200
Directory.CreateDirectory(needs.OutputPath);
199201
Directory.CreateDirectory(needs.ReferencesDirectoryName);
200202
return needs;

src/BitMono.CLI/Program.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@ private static async Task<int> Main(string[] args)
6969
logger.Information("File: {0}", needs.FileName);
7070
logger.Information("Dependencies (libs): {0}", string.Join(", ", needs.ReferencesDirectoryNames));
7171
logger.Information("Everything is seems to be ok, starting obfuscation..");
72-
logger.Information(AsciiArt);
72+
if (!needs.NoLogo)
73+
{
74+
logger.Information(AsciiArt);
75+
}
7376

7477
var info = new IncompleteFileInfo(needs.FileName, needs.ReferencesDirectoryNames, needs.OutputPath);
7578
var engine = new BitMonoStarter(serviceProvider);

src/BitMono.GlobalTool/Program.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ private static async Task<int> Main(string[] args)
5757
logger.Information("File: {0}", needs.FileName);
5858
logger.Information("Dependencies (libs): {0}", string.Join(", ", needs.ReferencesDirectoryNames));
5959
logger.Information("Everything is seems to be ok, starting obfuscation..");
60-
logger.Information(AsciiArt);
60+
if (!needs.NoLogo)
61+
{
62+
logger.Information(AsciiArt);
63+
}
6164

6265
var info = new IncompleteFileInfo(needs.FileName, needs.ReferencesDirectoryNames, needs.OutputPath);
6366
var engine = new BitMonoStarter(serviceProvider);

0 commit comments

Comments
 (0)