Skip to content

Commit

Permalink
优化信息打印
Browse files Browse the repository at this point in the history
  • Loading branch information
nilaoda committed Aug 17, 2023
1 parent ae2b8d8 commit 28c3fd4
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions BBDown/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,6 @@ public static async Task<int> Main(params string[] args)
//TV登录
loginTVCommand.SetHandler(LoginTV);

Console.BackgroundColor = ConsoleColor.DarkBlue;
Console.ForegroundColor = ConsoleColor.White;
var ver = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version!;
Console.Write($"BBDown version {ver.Major}.{ver.Minor}.{ver.Build}, Bilibili Downloader.\r\n");
Console.ResetColor();
Console.Write("欢迎到讨论区交流:\r\n" +
"https://github.com/nilaoda/BBDown/discussions\r\n");
Console.WriteLine();

var parser = new CommandLineBuilder(rootCommand)
.UseDefaults()
.EnablePosixBundling(false)
Expand All @@ -106,7 +97,10 @@ public static async Task<int> Main(params string[] args)
//显式抛出异常
if (commandLineResult.Errors.Count > 0)
{
LogError(commandLineResult.Errors.First().Message);
Console.ForegroundColor = ConsoleColor.Red;
Console.Error.WriteLine(commandLineResult.Errors.First().Message);
Console.ResetColor();
Console.Error.WriteLine($"请使用 BBDown --help 查看帮助");
return 1;
}

Expand All @@ -130,6 +124,15 @@ public static async Task<int> Main(params string[] args)
}
if (newArgsList.Contains("--debug")) Config.DEBUG_LOG = true;

Console.BackgroundColor = ConsoleColor.DarkBlue;
Console.ForegroundColor = ConsoleColor.White;
var ver = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version!;
Console.Write($"BBDown version {ver.Major}.{ver.Minor}.{ver.Build}, Bilibili Downloader.\r\n");
Console.ResetColor();
Console.Write("遇到问题请首先到以下地址查阅有无相关信息:\r\n" +
"https://github.com/nilaoda/BBDown/issues\r\n");
Console.WriteLine();

//处理配置文件
BBDownConfigParser.HandleConfig(newArgsList, rootCommand);

Expand Down

0 comments on commit 28c3fd4

Please sign in to comment.