Skip to content

Commit 3e85dad

Browse files
committed
**
1 parent cca59f2 commit 3e85dad

File tree

7 files changed

+92
-54
lines changed

7 files changed

+92
-54
lines changed

SmartImage.Lib 3/Engines/Impl/Search/EHentaiEngine.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ public async ValueTask ApplyAsync(SearchConfig cfg)
108108
Debug.WriteLine($"{Name} logged in - {ok}", nameof(ApplyAsync));
109109

110110
}
111+
else {
112+
Debug.WriteLine("Not logging in");
113+
}
111114
}
112115

113116
/*
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
// Author: Deci | Project: SmartImage.Rdx | Name: CustomHelpProvider.cs
2+
// Date: 2024/04/10 @ 18:04:50
3+
4+
using Spectre.Console.Cli;
5+
using Spectre.Console.Cli.Help;
6+
using Spectre.Console.Rendering;
7+
8+
namespace SmartImage.Rdx;
9+
10+
internal class CustomHelpProvider : HelpProvider
11+
{
12+
public CustomHelpProvider(ICommandAppSettings settings)
13+
: base(settings)
14+
{
15+
}
16+
17+
public override IEnumerable<IRenderable> GetUsage(ICommandModel model, ICommandInfo? command)
18+
{
19+
return base.GetUsage(model, command);
20+
}
21+
22+
/*public override IEnumerable<IRenderable> GetExamples(ICommandModel model, ICommandInfo? command)
23+
{
24+
return
25+
[
26+
new Text(
27+
"smartimage \"C:\\Users\\Deci\\Pictures\\Epic anime\\Kallen_FINAL_1-3.png\" --search-engines All --output-format \"Delimited\" --output-file \"output.csv\" --read-cookies")
28+
];
29+
30+
return base.GetExamples(model, command);
31+
}*/
32+
33+
public override IEnumerable<IRenderable> GetDescription(ICommandModel model, ICommandInfo? command)
34+
{
35+
return base.GetDescription(model, command);
36+
}
37+
38+
public override IEnumerable<IRenderable> GetFooter(ICommandModel model, ICommandInfo? command)
39+
{
40+
return base.GetFooter(model, command);
41+
}
42+
43+
/*public override IEnumerable<IRenderable> GetHeader(ICommandModel model, ICommandInfo? command)
44+
{
45+
46+
switch (command) {
47+
case null:
48+
49+
break;
50+
}
51+
52+
return [Text.Empty];
53+
}*/
54+
}

SmartImage.Rdx/Program.cs

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using Spectre.Console;
55
using Spectre.Console.Cli;
66
using SmartImage.Rdx.Shell;
7-
using Spectre.Console.Cli.Help;
87

98
namespace SmartImage.Rdx;
109

@@ -23,15 +22,12 @@ namespace SmartImage.Rdx;
2322
public static class Program
2423
{
2524

26-
private static readonly Assembly s_assembly = Assembly.GetExecutingAssembly();
27-
private static readonly string s_version = s_assembly.GetName().Version.ToString();
28-
2925
public static async Task<int> Main(string[] args)
3026
{
3127
Debug.WriteLine(AConsole.Profile.Height);
3228
Debug.WriteLine(Console.BufferHeight);
3329

34-
var ff = CliFormat.LoadFigletFontFromResource(nameof(R2.Fg_larry3d), out var ms);
30+
var ff = CliFormat.LoadFigletFontFromResource(nameof(R2.Fg_larry3d), out var ms);
3531

3632
// ms?.Dispose();
3733

@@ -52,24 +48,38 @@ public static async Task<int> Main(string[] args)
5248
// var env = Environment.GetEnvironmentVariables(EnvironmentVariableTarget.Process);
5349

5450
var app = new CommandApp<SearchCommand>();
55-
51+
5652
app.Configure(c =>
5753
{
5854
c.PropagateExceptions();
59-
var helpProvider = new HelpProvider(c.Settings);
55+
var helpProvider = new CustomHelpProvider(c.Settings);
6056
c.SetHelpProvider(helpProvider);
61-
57+
58+
/*
59+
c.SetExceptionHandler((x, i) =>
60+
{
61+
AConsole.WriteLine($"{x}");
62+
Console.ReadKey();
63+
64+
});
65+
*/
66+
6267
//...
6368
});
6469

6570
try {
6671
var x = await app.RunAsync(args);
67-
72+
73+
if (x != SearchCommand.EC_OK) {
74+
AConsole.Confirm("Press any key to continue");
75+
}
76+
77+
// Console.ReadLine();
78+
6879
return x;
6980
}
7081
catch (Exception e) {
7182
AConsole.WriteException(e);
72-
7383
return SearchCommand.EC_ERROR;
7484
}
7585
}

SmartImage.Rdx/ResultModel.cs

Lines changed: 0 additions & 35 deletions
This file was deleted.

SmartImage.Rdx/SearchCommandSettings.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ internal sealed class SearchCommandSettings : CommandSettings
3434

3535
[CommandOption("--read-cookies")]
3636
[DefaultValue(SearchConfig.READCOOKIES_DEFAULT)]
37-
[Description("Read cookies")]
37+
[Description("Read cookies from browser")]
3838
public bool? ReadCookies { get; internal set; }
3939

4040
#region
@@ -45,7 +45,7 @@ internal sealed class SearchCommandSettings : CommandSettings
4545
public OutputFileFormat OutputFileFormat { get; internal set; }
4646

4747
[CommandOption("-o|--output-file")]
48-
[Description("Output file")]
48+
[Description("Output file name")]
4949
public string? OutputFile { get; internal set; }
5050

5151
[CommandOption("-d|--output-delim")]
@@ -66,9 +66,11 @@ internal sealed class SearchCommandSettings : CommandSettings
6666
#region
6767

6868
[CommandOption("-x|--command-exe")]
69+
[Description($"Command/executable to invoke upon completion")]
6970
public string? Command { get; internal set; }
7071

7172
[CommandOption("-c|--command-args")]
73+
[Description($"Arguments to pass to command")]
7274
public string? CommandArguments { get; internal set; }
7375

7476
#endregion

SmartImage.Rdx/Shell/CliFormat.Elements.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using SmartImage.Lib.Engines;
1+
using System.Reflection;
2+
using SmartImage.Lib.Engines;
23
using Spectre.Console;
34

45
namespace SmartImage.Rdx.Shell;
@@ -41,9 +42,11 @@ static CliFormat() { }
4142

4243
internal static readonly Capabilities ProfileCapabilities = AConsole.Profile.Capabilities;
4344

44-
internal static readonly bool IsLinux = OperatingSystem.IsLinux();
45-
internal static readonly bool IsWindows = OperatingSystem.IsWindows();
46-
internal static readonly bool IsMacOs = OperatingSystem.IsMacOS();
45+
internal static readonly bool IsLinux = OperatingSystem.IsLinux();
46+
internal static readonly bool IsWindows = OperatingSystem.IsWindows();
47+
internal static readonly bool IsMacOs = OperatingSystem.IsMacOS();
48+
private static readonly Assembly s_assembly = Assembly.GetExecutingAssembly();
49+
private static readonly string s_version = s_assembly.GetName().Version.ToString();
4750

4851
public static Grid CreateInfoGrid()
4952
{
@@ -57,7 +60,8 @@ public static Grid CreateInfoGrid()
5760
["Terminal ANSI"] = ProfileCapabilities.Ansi,
5861
["Terminal colors"] = ProfileCapabilities.ColorSystem,
5962
["Terminal links"] = ProfileCapabilities.Links,
60-
["Terminal Unicode"] = ProfileCapabilities.Unicode
63+
["Terminal Unicode"] = ProfileCapabilities.Unicode,
64+
["Version"] = $"{s_version}"
6165
};
6266

6367
foreach ((string? key, var value) in dict) {

SmartImage.Rdx/SmartImage.Rdx.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
<PackageProjectUrl>https://github.com/Decimation/SmartImage</PackageProjectUrl>
1313
<RepositoryUrl>https://github.com/Decimation/SmartImage</RepositoryUrl>
1414
<AssemblyName>SmartImage</AssemblyName>
15-
15+
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
1616
</PropertyGroup>
1717
<PropertyGroup>
1818
<SatelliteResourceLanguages>en-US;en</SatelliteResourceLanguages>
19-
<Version>$(VersionPrefix)</Version>
19+
<Version>1.0.1</Version>
2020
</PropertyGroup>
2121
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
2222
<DefineConstants>DEBUG;TRACE;JETBRAINS_ANNOTATIONS</DefineConstants>

0 commit comments

Comments
 (0)