Overhaul LibationCli

Add version verb with option to check for upgrade
Add Search verb to search the library
Add export file type inference
Add more set-status options
Add console progress bar and ETA
Add processable option to liberate specific book IDs
Scan accounts by nickname or account ID
Improve startup performance for halp and on parsing error
More useful error messages
This commit is contained in:
Mbucari 2023-07-02 14:32:54 -06:00
parent bb05847b25
commit 29803c6ba0
14 changed files with 477 additions and 146 deletions

View file

@ -1,14 +1,8 @@
using System;
using System.Collections.Generic;
using AppScaffolding;
using CommandLine;
using System;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using AppScaffolding;
using CommandLine;
using CommandLine.Text;
using Dinah.Core;
using Dinah.Core.Collections;
using Dinah.Core.Collections.Generic;
namespace LibationCli
{
@ -16,6 +10,11 @@ namespace LibationCli
{
public static void Initialize()
{
//Determine variety by the dlls present in the current directory.
//Necessary to be able to check for upgrades.
var variety = System.IO.File.Exists("System.Windows.Forms.dll") ? Variety.Classic : Variety.Chardonnay;
LibationScaffolding.SetReleaseIdentifier(variety);
//***********************************************//
// //
// do not use Configuration before this line //
@ -26,28 +25,6 @@ namespace LibationCli
LibationScaffolding.RunPostConfigMigrations(config);
LibationScaffolding.RunPostMigrationScaffolding(config);
#if !DEBUG
checkForUpdate();
#endif
}
private static void checkForUpdate()
{
var upgradeProperties = LibationScaffolding.GetLatestRelease();
if (upgradeProperties is null)
return;
var origColor = Console.ForegroundColor;
try
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine($"UPDATE AVAILABLE @ {upgradeProperties.ZipUrl}");
}
finally
{
Console.ForegroundColor = origColor;
}
}
public static Type[] LoadVerbs() => Assembly.GetExecutingAssembly()