Use Spectre.Console.

This commit is contained in:
2021-09-13 00:07:13 +01:00
parent fc0f03ba5a
commit 7dfeb330d9
2 changed files with 113 additions and 83 deletions

View File

@@ -51,69 +51,69 @@
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml" />
<Reference Include="System"/>
<Reference Include="System.Core"/>
<Reference Include="System.Xml"/>
</ItemGroup>
<ItemGroup>
<Compile Include="Commands\Database\DatabaseFamily.cs" />
<Compile Include="Commands\Database\Statistics.cs" />
<Compile Include="Commands\Database\Update.cs" />
<Compile Include="Commands\Device\DeviceFamily.cs" />
<Compile Include="Commands\Device\Info.cs" />
<Compile Include="Commands\Device\DeviceReport.cs" />
<Compile Include="Commands\Device\List.cs" />
<Compile Include="Commands\Filesystem\Info.cs" />
<Compile Include="Commands\Filesystem\ExtractFiles.cs" />
<Compile Include="Commands\Filesystem\FilesystemFamily.cs" />
<Compile Include="Commands\Filesystem\Options.cs" />
<Compile Include="Commands\Filesystem\Ls.cs" />
<Compile Include="Commands\Formats.cs" />
<Compile Include="Commands\Image\Checksum.cs" />
<Compile Include="Commands\Image\Compare.cs" />
<Compile Include="Commands\Image\Convert.cs" />
<Compile Include="Commands\Image\CreateSidecar.cs" />
<Compile Include="Commands\Image\Decode.cs" />
<Compile Include="Commands\Image\Entropy.cs" />
<Compile Include="Commands\Image\ImageFamily.cs" />
<Compile Include="Commands\Image\Info.cs" />
<Compile Include="Commands\Image\Options.cs" />
<Compile Include="Commands\Image\Print.cs" />
<Compile Include="Commands\Image\Verify.cs" />
<Compile Include="Commands\ListNamespaces.cs" />
<Compile Include="Commands\Media\Dump.cs" />
<Compile Include="Commands\Media\MediaFamily.cs" />
<Compile Include="Commands\Media\Info.cs" />
<Compile Include="Commands\Media\Scan.cs" />
<Compile Include="Commands\Archive\ArchiveFamily.cs" />
<Compile Include="Commands\Archive\Info.cs" />
<Compile Include="Commands\Remote.cs" />
<Compile Include="Main.cs" />
<Compile Include="Commands\Configure.cs" />
<Compile Include="Progress.cs" />
<Compile Include="Commands\ListEncodings.cs" />
<Compile Include="Commands\Database\DatabaseFamily.cs"/>
<Compile Include="Commands\Database\Statistics.cs"/>
<Compile Include="Commands\Database\Update.cs"/>
<Compile Include="Commands\Device\DeviceFamily.cs"/>
<Compile Include="Commands\Device\Info.cs"/>
<Compile Include="Commands\Device\DeviceReport.cs"/>
<Compile Include="Commands\Device\List.cs"/>
<Compile Include="Commands\Filesystem\Info.cs"/>
<Compile Include="Commands\Filesystem\ExtractFiles.cs"/>
<Compile Include="Commands\Filesystem\FilesystemFamily.cs"/>
<Compile Include="Commands\Filesystem\Options.cs"/>
<Compile Include="Commands\Filesystem\Ls.cs"/>
<Compile Include="Commands\Formats.cs"/>
<Compile Include="Commands\Image\Checksum.cs"/>
<Compile Include="Commands\Image\Compare.cs"/>
<Compile Include="Commands\Image\Convert.cs"/>
<Compile Include="Commands\Image\CreateSidecar.cs"/>
<Compile Include="Commands\Image\Decode.cs"/>
<Compile Include="Commands\Image\Entropy.cs"/>
<Compile Include="Commands\Image\ImageFamily.cs"/>
<Compile Include="Commands\Image\Info.cs"/>
<Compile Include="Commands\Image\Options.cs"/>
<Compile Include="Commands\Image\Print.cs"/>
<Compile Include="Commands\Image\Verify.cs"/>
<Compile Include="Commands\ListNamespaces.cs"/>
<Compile Include="Commands\Media\Dump.cs"/>
<Compile Include="Commands\Media\MediaFamily.cs"/>
<Compile Include="Commands\Media\Info.cs"/>
<Compile Include="Commands\Media\Scan.cs"/>
<Compile Include="Commands\Archive\ArchiveFamily.cs"/>
<Compile Include="Commands\Archive\Info.cs"/>
<Compile Include="Commands\Remote.cs"/>
<Compile Include="Main.cs"/>
<Compile Include="Commands\Configure.cs"/>
<Compile Include="Progress.cs"/>
<Compile Include="Commands\ListEncodings.cs"/>
</ItemGroup>
<ItemGroup>
<Folder Include="Commands\" />
<Folder Include="Commands\"/>
</ItemGroup>
<ProjectExtensions>
<MonoDevelop>
<Properties>
<Policies>
<VersionControlPolicy>
<CommitMessageStyle Indent=" " LastFilePostfix=":&#xA; " LineAlign="0" IncludeDirectoryPaths="True" />
<CommitMessageStyle Indent=" " LastFilePostfix=":&#xA; " LineAlign="0" IncludeDirectoryPaths="True"/>
</VersionControlPolicy>
<ChangeLogPolicy UpdateMode="ProjectRoot" VcsIntegration="RequireEntry">
<MessageStyle Header="" Indent="" LastFilePostfix=":&#xA; " LineAlign="2" IncludeDirectoryPaths="True" />
<inheritsSet />
<inheritsScope />
<MessageStyle Header="" Indent="" LastFilePostfix=":&#xA; " LineAlign="2" IncludeDirectoryPaths="True"/>
<inheritsSet/>
<inheritsScope/>
</ChangeLogPolicy>
<DotNetNamingPolicy DirectoryNamespaceAssociation="PrefixedHierarchical" ResourceNamePolicy="MSBuild" />
<TextStylePolicy TabWidth="4" IndentWidth="4" RemoveTrailingWhitespace="True" NoTabsAfterNonTabs="False" EolMarker="Native" FileWidth="80" TabsToSpaces="True" scope="text/plain" />
<DotNetNamingPolicy DirectoryNamespaceAssociation="PrefixedHierarchical" ResourceNamePolicy="MSBuild"/>
<TextStylePolicy TabWidth="4" IndentWidth="4" RemoveTrailingWhitespace="True" NoTabsAfterNonTabs="False" EolMarker="Native" FileWidth="80" TabsToSpaces="True" scope="text/plain"/>
<NameConventionPolicy>
<Rules>
<NamingRule Name="Namespaces" AffectedEntity="Namespace" VisibilityMask="VisibilityMask" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True" />
<NamingRule Name="Types" AffectedEntity="Class, Struct, Enum, Delegate" VisibilityMask="VisibilityMask" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True" />
<NamingRule Name="Namespaces" AffectedEntity="Namespace" VisibilityMask="VisibilityMask" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True"/>
<NamingRule Name="Types" AffectedEntity="Class, Struct, Enum, Delegate" VisibilityMask="VisibilityMask" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True"/>
<NamingRule Name="Interfaces" AffectedEntity="Interface" VisibilityMask="VisibilityMask" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True">
<RequiredPrefixes>
<String>I</String>
@@ -134,28 +134,28 @@
<String>Exception</String>
</RequiredSuffixes>
</NamingRule>
<NamingRule Name="Methods" AffectedEntity="Methods" VisibilityMask="VisibilityMask" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True" />
<NamingRule Name="Static Readonly Fields" AffectedEntity="ReadonlyField" VisibilityMask="Internal, Protected, Public" NamingStyle="PascalCase" IncludeInstanceMembers="False" IncludeStaticEntities="True" />
<NamingRule Name="Fields (Non Private)" AffectedEntity="Field" VisibilityMask="Internal, Protected, Public" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True" />
<NamingRule Name="ReadOnly Fields (Non Private)" AffectedEntity="ReadonlyField" VisibilityMask="Internal, Protected, Public" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="False" />
<NamingRule Name="Methods" AffectedEntity="Methods" VisibilityMask="VisibilityMask" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True"/>
<NamingRule Name="Static Readonly Fields" AffectedEntity="ReadonlyField" VisibilityMask="Internal, Protected, Public" NamingStyle="PascalCase" IncludeInstanceMembers="False" IncludeStaticEntities="True"/>
<NamingRule Name="Fields (Non Private)" AffectedEntity="Field" VisibilityMask="Internal, Protected, Public" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True"/>
<NamingRule Name="ReadOnly Fields (Non Private)" AffectedEntity="ReadonlyField" VisibilityMask="Internal, Protected, Public" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="False"/>
<NamingRule Name="Fields (Private)" AffectedEntity="Field, ReadonlyField" VisibilityMask="Private" NamingStyle="CamelCase" IncludeInstanceMembers="True" IncludeStaticEntities="False">
<AllowedPrefixes>
<String>_</String>
<String>m_</String>
</AllowedPrefixes>
</NamingRule>
<NamingRule Name="Static Fields (Private)" AffectedEntity="Field" VisibilityMask="Private" NamingStyle="CamelCase" IncludeInstanceMembers="False" IncludeStaticEntities="True" />
<NamingRule Name="Static Fields (Private)" AffectedEntity="Field" VisibilityMask="Private" NamingStyle="CamelCase" IncludeInstanceMembers="False" IncludeStaticEntities="True"/>
<NamingRule Name="ReadOnly Fields (Private)" AffectedEntity="ReadonlyField" VisibilityMask="Private" NamingStyle="CamelCase" IncludeInstanceMembers="True" IncludeStaticEntities="False">
<AllowedPrefixes>
<String>_</String>
<String>m_</String>
</AllowedPrefixes>
</NamingRule>
<NamingRule Name="Constant Fields" AffectedEntity="ConstantField" VisibilityMask="VisibilityMask" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True" />
<NamingRule Name="Properties" AffectedEntity="Property" VisibilityMask="VisibilityMask" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True" />
<NamingRule Name="Events" AffectedEntity="Event" VisibilityMask="VisibilityMask" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True" />
<NamingRule Name="Enum Members" AffectedEntity="EnumMember" VisibilityMask="VisibilityMask" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True" />
<NamingRule Name="Parameters" AffectedEntity="Parameter" VisibilityMask="VisibilityMask" NamingStyle="CamelCase" IncludeInstanceMembers="True" IncludeStaticEntities="True" />
<NamingRule Name="Constant Fields" AffectedEntity="ConstantField" VisibilityMask="VisibilityMask" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True"/>
<NamingRule Name="Properties" AffectedEntity="Property" VisibilityMask="VisibilityMask" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True"/>
<NamingRule Name="Events" AffectedEntity="Event" VisibilityMask="VisibilityMask" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True"/>
<NamingRule Name="Enum Members" AffectedEntity="EnumMember" VisibilityMask="VisibilityMask" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True"/>
<NamingRule Name="Parameters" AffectedEntity="Parameter" VisibilityMask="VisibilityMask" NamingStyle="CamelCase" IncludeInstanceMembers="True" IncludeStaticEntities="True"/>
<NamingRule Name="Type Parameters" AffectedEntity="TypeParameter" VisibilityMask="VisibilityMask" NamingStyle="PascalCase" IncludeInstanceMembers="True" IncludeStaticEntities="True">
<RequiredPrefixes>
<String>T</String>
@@ -163,9 +163,9 @@
</NamingRule>
</Rules>
</NameConventionPolicy>
<StandardHeader IncludeInNewFiles="True" Text="/***************************************************************************&#xA;Aaru Data Preservation Suite&#xA;----------------------------------------------------------------------------&#xA; &#xA;Filename : ${FileName}&#xA;Author(s) : ${AuthorName} &lt;${AuthorEmail}&gt;&#xA;&#xA;Component : Component&#xA; &#xA;--[ Description ] ----------------------------------------------------------&#xA; &#xA; Description&#xA; &#xA;--[ License ] --------------------------------------------------------------&#xA; &#xA; This program is free software: you can redistribute it and/or modify&#xA; it under the terms of the GNU General Public License as&#xA; published by the Free Software Foundation, either version 3 of the&#xA; License, or (at your option) any later version.&#xA;&#xA; This program is distributed in the hope that it will be useful,&#xA; but WITHOUT ANY WARRANTY; without even the implied warranty of&#xA; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the&#xA; GNU General Public License for more details.&#xA;&#xA; You should have received a copy of the GNU General Public License&#xA; along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.&#xA;&#xA;----------------------------------------------------------------------------&#xA;Copyright © 2011-${Year} ${CopyrightHolder}&#xA;****************************************************************************/" />
<TextStylePolicy FileWidth="120" TabWidth="4" IndentWidth="4" RemoveTrailingWhitespace="True" NoTabsAfterNonTabs="False" EolMarker="Native" TabsToSpaces="True" scope="text/x-csharp" />
<CSharpFormattingPolicy IndentBlock="True" IndentBraces="False" IndentSwitchSection="True" IndentSwitchCaseSection="True" LabelPositioning="OneLess" NewLinesForBracesInTypes="True" NewLinesForBracesInMethods="True" NewLinesForBracesInProperties="True" NewLinesForBracesInAccessors="True" NewLinesForBracesInAnonymousMethods="True" NewLinesForBracesInControlBlocks="True" NewLinesForBracesInAnonymousTypes="True" NewLinesForBracesInObjectCollectionArrayInitializers="True" NewLinesForBracesInLambdaExpressionBody="True" NewLineForElse="True" NewLineForCatch="True" NewLineForFinally="True" NewLineForMembersInObjectInit="True" NewLineForMembersInAnonymousTypes="True" NewLineForClausesInQuery="True" SpacingAfterMethodDeclarationName="False" SpaceWithinMethodDeclarationParenthesis="False" SpaceBetweenEmptyMethodDeclarationParentheses="False" SpaceAfterMethodCallName="False" SpaceWithinMethodCallParentheses="False" SpaceBetweenEmptyMethodCallParentheses="False" SpaceWithinExpressionParentheses="False" SpaceWithinCastParentheses="False" SpaceWithinOtherParentheses="False" SpaceAfterCast="False" SpacesIgnoreAroundVariableDeclaration="False" SpaceBeforeOpenSquareBracket="False" SpaceBetweenEmptySquareBrackets="False" SpaceWithinSquareBrackets="False" SpaceAfterColonInBaseTypeDeclaration="True" SpaceAfterComma="True" SpaceAfterDot="False" SpaceAfterSemicolonsInForStatement="True" SpaceBeforeColonInBaseTypeDeclaration="True" SpaceBeforeComma="False" SpaceBeforeDot="False" SpaceBeforeSemicolonsInForStatement="False" SpacingAroundBinaryOperator="Single" WrappingPreserveSingleLine="True" WrappingKeepStatementsOnSingleLine="True" PlaceSystemDirectiveFirst="True" SpaceAfterControlFlowStatementKeyword="False" scope="text/x-csharp" />
<StandardHeader IncludeInNewFiles="True" Text="/***************************************************************************&#xA;Aaru Data Preservation Suite&#xA;----------------------------------------------------------------------------&#xA; &#xA;Filename : ${FileName}&#xA;Author(s) : ${AuthorName} &lt;${AuthorEmail}&gt;&#xA;&#xA;Component : Component&#xA; &#xA;--[ Description ] ----------------------------------------------------------&#xA; &#xA; Description&#xA; &#xA;--[ License ] --------------------------------------------------------------&#xA; &#xA; This program is free software: you can redistribute it and/or modify&#xA; it under the terms of the GNU General Public License as&#xA; published by the Free Software Foundation, either version 3 of the&#xA; License, or (at your option) any later version.&#xA;&#xA; This program is distributed in the hope that it will be useful,&#xA; but WITHOUT ANY WARRANTY; without even the implied warranty of&#xA; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the&#xA; GNU General Public License for more details.&#xA;&#xA; You should have received a copy of the GNU General Public License&#xA; along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.&#xA;&#xA;----------------------------------------------------------------------------&#xA;Copyright © 2011-${Year} ${CopyrightHolder}&#xA;****************************************************************************/"/>
<TextStylePolicy FileWidth="120" TabWidth="4" IndentWidth="4" RemoveTrailingWhitespace="True" NoTabsAfterNonTabs="False" EolMarker="Native" TabsToSpaces="True" scope="text/x-csharp"/>
<CSharpFormattingPolicy IndentBlock="True" IndentBraces="False" IndentSwitchSection="True" IndentSwitchCaseSection="True" LabelPositioning="OneLess" NewLinesForBracesInTypes="True" NewLinesForBracesInMethods="True" NewLinesForBracesInProperties="True" NewLinesForBracesInAccessors="True" NewLinesForBracesInAnonymousMethods="True" NewLinesForBracesInControlBlocks="True" NewLinesForBracesInAnonymousTypes="True" NewLinesForBracesInObjectCollectionArrayInitializers="True" NewLinesForBracesInLambdaExpressionBody="True" NewLineForElse="True" NewLineForCatch="True" NewLineForFinally="True" NewLineForMembersInObjectInit="True" NewLineForMembersInAnonymousTypes="True" NewLineForClausesInQuery="True" SpacingAfterMethodDeclarationName="False" SpaceWithinMethodDeclarationParenthesis="False" SpaceBetweenEmptyMethodDeclarationParentheses="False" SpaceAfterMethodCallName="False" SpaceWithinMethodCallParentheses="False" SpaceBetweenEmptyMethodCallParentheses="False" SpaceWithinExpressionParentheses="False" SpaceWithinCastParentheses="False" SpaceWithinOtherParentheses="False" SpaceAfterCast="False" SpacesIgnoreAroundVariableDeclaration="False" SpaceBeforeOpenSquareBracket="False" SpaceBetweenEmptySquareBrackets="False" SpaceWithinSquareBrackets="False" SpaceAfterColonInBaseTypeDeclaration="True" SpaceAfterComma="True" SpaceAfterDot="False" SpaceAfterSemicolonsInForStatement="True" SpaceBeforeColonInBaseTypeDeclaration="True" SpaceBeforeComma="False" SpaceBeforeDot="False" SpaceBeforeSemicolonsInForStatement="False" SpacingAroundBinaryOperator="Single" WrappingPreserveSingleLine="True" WrappingKeepStatementsOnSingleLine="True" PlaceSystemDirectiveFirst="True" SpaceAfterControlFlowStatementKeyword="False" scope="text/x-csharp"/>
</Policies>
</Properties>
</MonoDevelop>
@@ -195,8 +195,8 @@
<Project>{CC48B324-A532-4A45-87A6-6F91F7141E8D}</Project>
<Name>Aaru.Checksums</Name>
</ProjectReference>
<ProjectReference Include="..\Aaru.Database\Aaru.Database.csproj" />
<ProjectReference Include="..\Aaru.Gui\Aaru.Gui.csproj" />
<ProjectReference Include="..\Aaru.Database\Aaru.Database.csproj"/>
<ProjectReference Include="..\Aaru.Gui\Aaru.Gui.csproj"/>
<ProjectReference Include="..\Aaru.Helpers\Aaru.Helpers.csproj">
<Project>{F8BDF57B-1571-4CD0-84B3-B422088D359A}</Project>
<Name>Aaru.Helpers</Name>
@@ -257,29 +257,31 @@
</Folder>
</ItemGroup>
<ItemGroup>
<None Include="..\.github\CODE_OF_CONDUCT.md" />
<None Include="..\.github\CODE_OF_CONDUCT.md"/>
</ItemGroup>
<ItemGroup>
<Content Include="..\.github\PULL_REQUEST_TEMPLATE.md" />
<Content Include="..\.github\PULL_REQUEST_TEMPLATE.md"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.0-preview.7.21378.4" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.20104.2" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="6.0.0-preview.7.21377.19" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.0-preview.7.21378.4"/>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1"/>
<PackageReference Include="Spectre.Console" Version="0.41.0"/>
<PackageReference Include="Spectre.Console.Analyzer" Version="0.41.0"/>
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.20104.2"/>
<PackageReference Include="System.Text.Encoding.CodePages" Version="6.0.0-preview.7.21377.19"/>
<PackageReference Include="System.ValueTuple" Version="4.5.0"/>
<PackageReference Include="Unclassified.NetRevisionTask" Version="0.4.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Collections" Version="4.3.0" />
<PackageReference Include="System.Diagnostics.Debug" Version="4.3.0" />
<PackageReference Include="System.IO.FileSystem.Primitives" Version="4.3.0" />
<PackageReference Include="System.Runtime.Extensions" Version="4.3.1" />
<PackageReference Include="System.Runtime.Handles" Version="4.3.0" />
<PackageReference Include="System.Runtime.InteropServices" Version="4.3.0" />
<PackageReference Include="System.Net.Primitives" Version="4.3.1" />
<PackageReference Include="System.IO.FileSystem" Version="4.3.0" />
<PackageReference Include="System.Collections" Version="4.3.0"/>
<PackageReference Include="System.Diagnostics.Debug" Version="4.3.0"/>
<PackageReference Include="System.IO.FileSystem.Primitives" Version="4.3.0"/>
<PackageReference Include="System.Runtime.Extensions" Version="4.3.1"/>
<PackageReference Include="System.Runtime.Handles" Version="4.3.0"/>
<PackageReference Include="System.Runtime.InteropServices" Version="4.3.0"/>
<PackageReference Include="System.Net.Primitives" Version="4.3.1"/>
<PackageReference Include="System.IO.FileSystem" Version="4.3.0"/>
<PackageReference Update="Packaging.Targets">
<Version>0.1.189</Version>
</PackageReference>

View File

@@ -50,6 +50,7 @@ using Aaru.Database;
using Aaru.Settings;
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore;
using Spectre.Console;
namespace Aaru
{
@@ -61,6 +62,11 @@ namespace Aaru
public static int Main([NotNull] string[] args)
{
IAnsiConsole stderrConsole = AnsiConsole.Create(new AnsiConsoleSettings
{
Out = new AnsiConsoleOutput(System.Console.Error)
});
object[] attributes = typeof(MainClass).Assembly.GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
_assemblyTitle = ((AssemblyTitleAttribute)attributes[0]).Title;
attributes = typeof(MainClass).Assembly.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
@@ -77,9 +83,29 @@ namespace Aaru
return Gui.Main.Start(args);
}
AaruConsole.WriteLineEvent += System.Console.WriteLine;
AaruConsole.WriteEvent += System.Console.Write;
AaruConsole.ErrorWriteLineEvent += System.Console.Error.WriteLine;
AaruConsole.WriteLineEvent += (format, objects) =>
{
if(objects is null)
AnsiConsole.MarkupLine(format);
else
AnsiConsole.MarkupLine(format, objects);
};
AaruConsole.WriteEvent += (format, objects) =>
{
if(objects is null)
AnsiConsole.Markup(format);
else
AnsiConsole.Markup(format, objects);
};
AaruConsole.ErrorWriteLineEvent += (format, objects) =>
{
if(objects is null)
stderrConsole.MarkupLine(format);
else
stderrConsole.MarkupLine(format, objects);
};
Settings.Settings.LoadSettings();
@@ -220,8 +246,10 @@ namespace Aaru
internal static void PrintCopyright()
{
AaruConsole.WriteLine("{0} {1}", _assemblyTitle, _assemblyVersion?.InformationalVersion);
AaruConsole.WriteLine("{0}", _assemblyCopyright);
AaruConsole.WriteLine("[bold][red]{0}[/] [green]{1}[/][/]", _assemblyTitle,
_assemblyVersion?.InformationalVersion);
AaruConsole.WriteLine("[bold][blue]{0}[/][/]", _assemblyCopyright);
AaruConsole.WriteLine();
}
}