Rename commands and add aliases.

This commit is contained in:
2020-01-03 18:24:44 +00:00
parent 56e24f1ed9
commit 03573f1cb6
17 changed files with 43 additions and 38 deletions

View File

@@ -34,37 +34,37 @@
</e> </e>
<e p="Device" t="Include"> <e p="Device" t="Include">
<e p="DeviceFamily.cs" t="Include" /> <e p="DeviceFamily.cs" t="Include" />
<e p="DeviceInfo.cs" t="Include" />
<e p="DeviceReport.cs" t="Include" /> <e p="DeviceReport.cs" t="Include" />
<e p="ListDevices.cs" t="Include" /> <e p="Devices.cs" t="Include" />
<e p="Info.cs" t="Include" />
</e> </e>
<e p="Filesystem" t="Include"> <e p="Filesystem" t="Include">
<e p="ExtractFiles.cs" t="Include" /> <e p="ExtractFiles.cs" t="Include" />
<e p="FilesystemFamily.cs" t="Include" /> <e p="FilesystemFamily.cs" t="Include" />
<e p="ListOptions.cs" t="Include" />
<e p="Ls.cs" t="Include" /> <e p="Ls.cs" t="Include" />
<e p="Options.cs" t="Include" />
</e> </e>
<e p="Formats.cs" t="Include" /> <e p="Formats.cs" t="Include" />
<e p="Image" t="Include"> <e p="Image" t="Include">
<e p="Analyze.cs" t="Include" /> <e p="Analyze.cs" t="Include" />
<e p="Checksum.cs" t="Include" /> <e p="Checksum.cs" t="Include" />
<e p="Compare.cs" t="Include" /> <e p="Compare.cs" t="Include" />
<e p="ConvertImage.cs" t="Include" /> <e p="Convert.cs" t="Include" />
<e p="CreateSidecar.cs" t="Include" /> <e p="CreateSidecar.cs" t="Include" />
<e p="Decode.cs" t="Include" /> <e p="Decode.cs" t="Include" />
<e p="Entropy.cs" t="Include" /> <e p="Entropy.cs" t="Include" />
<e p="ImageFamily.cs" t="Include" /> <e p="ImageFamily.cs" t="Include" />
<e p="ImageInfo.cs" t="Include" /> <e p="Info.cs" t="Include" />
<e p="PrintHex.cs" t="Include" /> <e p="Print.cs" t="Include" />
<e p="Verify.cs" t="Include" /> <e p="Verify.cs" t="Include" />
</e> </e>
<e p="ListEncodings.cs" t="Include" /> <e p="ListEncodings.cs" t="Include" />
<e p="ListNamespaces.cs" t="Include" /> <e p="ListNamespaces.cs" t="Include" />
<e p="Media" t="Include"> <e p="Media" t="Include">
<e p="DumpMedia.cs" t="Include" /> <e p="Dump.cs" t="Include" />
<e p="Info.cs" t="Include" />
<e p="MediaFamily.cs" t="Include" /> <e p="MediaFamily.cs" t="Include" />
<e p="MediaInfo.cs" t="Include" /> <e p="Scan.cs" t="Include" />
<e p="MediaScan.cs" t="Include" />
</e> </e>
<e p="Remote.cs" t="Include" /> <e p="Remote.cs" t="Include" />
</e> </e>

View File

@@ -38,7 +38,6 @@ namespace DiscImageChef.Commands.Device
{ {
public DeviceFamily() : base("device", "Commands that talks to devices") public DeviceFamily() : base("device", "Commands that talks to devices")
{ {
AddAlias("d");
AddAlias("dev"); AddAlias("dev");
AddCommand(new DeviceInfoCommand()); AddCommand(new DeviceInfoCommand());

View File

@@ -54,7 +54,7 @@ namespace DiscImageChef.Commands.Device
{ {
internal class DeviceReportCommand : Command internal class DeviceReportCommand : Command
{ {
public DeviceReportCommand() : base("device-report", public DeviceReportCommand() : base("report",
"Tests the device capabilities and creates an JSON report of them.") "Tests the device capabilities and creates an JSON report of them.")
{ {
AddArgument(new Argument<string> AddArgument(new Argument<string>

View File

@@ -38,11 +38,11 @@ using DiscImageChef.Console;
using DiscImageChef.Core; using DiscImageChef.Core;
using DiscImageChef.Devices; using DiscImageChef.Devices;
namespace DiscImageChef.Commands namespace DiscImageChef.Commands.Device
{ {
internal class ListDevicesCommand : Command internal class ListDevicesCommand : Command
{ {
public ListDevicesCommand() : base("list-devices", "Lists all connected devices.") public ListDevicesCommand() : base("list", "Lists all connected devices.")
{ {
AddArgument(new Argument<string> AddArgument(new Argument<string>
{ {

View File

@@ -52,7 +52,7 @@ namespace DiscImageChef.Commands.Device
{ {
internal class DeviceInfoCommand : Command internal class DeviceInfoCommand : Command
{ {
public DeviceInfoCommand() : base("device-info", "Gets information about a device.") public DeviceInfoCommand() : base("info", "Gets information about a device.")
{ {
Add(new Option(new[] Add(new Option(new[]
{ {

View File

@@ -44,11 +44,11 @@ using DiscImageChef.Console;
using DiscImageChef.Core; using DiscImageChef.Core;
using FileAttributes = DiscImageChef.CommonTypes.Structs.FileAttributes; using FileAttributes = DiscImageChef.CommonTypes.Structs.FileAttributes;
namespace DiscImageChef.Commands namespace DiscImageChef.Commands.Filesystem
{ {
internal class ExtractFilesCommand : Command internal class ExtractFilesCommand : Command
{ {
public ExtractFilesCommand() : base("extract-files", "Extracts all files in disc image.") public ExtractFilesCommand() : base("extract", "Extracts all files in disc image.")
{ {
Add(new Option(new[] Add(new Option(new[]
{ {

View File

@@ -43,12 +43,14 @@ using DiscImageChef.CommonTypes.Structs;
using DiscImageChef.Console; using DiscImageChef.Console;
using DiscImageChef.Core; using DiscImageChef.Core;
namespace DiscImageChef.Commands namespace DiscImageChef.Commands.Filesystem
{ {
internal class LsCommand : Command internal class LsCommand : Command
{ {
public LsCommand() : base("ls", "Lists files in disc image.") public LsCommand() : base("list", "Lists files in disc image.")
{ {
AddAlias("ls");
Add(new Option(new[] Add(new Option(new[]
{ {
"--encoding", "-e" "--encoding", "-e"

View File

@@ -41,11 +41,11 @@ using DiscImageChef.CommonTypes.Interfaces;
using DiscImageChef.Console; using DiscImageChef.Console;
using DiscImageChef.Core; using DiscImageChef.Core;
namespace DiscImageChef.Commands namespace DiscImageChef.Commands.Filesystem
{ {
internal class ListOptionsCommand : Command internal class ListOptionsCommand : Command
{ {
public ListOptionsCommand() : base("list-options", public ListOptionsCommand() : base("options",
"Lists all options supported by read-only filesystems and writable media images.") => "Lists all options supported by read-only filesystems and writable media images.") =>
Handler = CommandHandler.Create(GetType().GetMethod(nameof(Invoke))); Handler = CommandHandler.Create(GetType().GetMethod(nameof(Invoke)));

View File

@@ -51,6 +51,8 @@ namespace DiscImageChef.Commands.Image
public ChecksumCommand() : base("checksum", "Checksums an image.") public ChecksumCommand() : base("checksum", "Checksums an image.")
{ {
AddAlias("chk");
Add(new Option(new[] Add(new Option(new[]
{ {
"--adler32", "-a" "--adler32", "-a"

View File

@@ -49,6 +49,8 @@ namespace DiscImageChef.Commands.Image
{ {
public CompareCommand() : base("compare", "Compares two disc images.") public CompareCommand() : base("compare", "Compares two disc images.")
{ {
AddAlias("cmp");
AddArgument(new Argument<string> AddArgument(new Argument<string>
{ {
Arity = ArgumentArity.ExactlyOne, Description = "First media image path", Name = "image-path1" Arity = ArgumentArity.ExactlyOne, Description = "First media image path", Name = "image-path1"

View File

@@ -52,7 +52,7 @@ namespace DiscImageChef.Commands.Image
{ {
internal class ConvertImageCommand : Command internal class ConvertImageCommand : Command
{ {
public ConvertImageCommand() : base("convert-image", "Converts one image to another format.") public ConvertImageCommand() : base("convert", "Converts one image to another format.")
{ {
Add(new Option(new[] Add(new Option(new[]
{ {

View File

@@ -43,7 +43,7 @@ namespace DiscImageChef.Commands.Image
{ {
internal class ImageInfoCommand : Command internal class ImageInfoCommand : Command
{ {
public ImageInfoCommand() : base("image-info", public ImageInfoCommand() : base("info",
"Opens a media image and shows information about the media it represents and metadata.") "Opens a media image and shows information about the media it represents and metadata.")
{ {
AddArgument(new Argument<string> AddArgument(new Argument<string>

View File

@@ -42,7 +42,7 @@ namespace DiscImageChef.Commands.Image
{ {
internal class PrintHexCommand : Command internal class PrintHexCommand : Command
{ {
public PrintHexCommand() : base("printhex", "Prints a sector, in hexadecimal values, to the console.") public PrintHexCommand() : base("print", "Prints a sector, in hexadecimal values, to the console.")
{ {
Add(new Option(new[] Add(new Option(new[]
{ {

View File

@@ -49,12 +49,12 @@ using DiscImageChef.Core.Logging;
using DiscImageChef.Devices; using DiscImageChef.Devices;
using Schemas; using Schemas;
namespace DiscImageChef.Commands namespace DiscImageChef.Commands.Media
{ {
// TODO: Add raw dumping // TODO: Add raw dumping
internal class DumpMediaCommand : Command internal class DumpMediaCommand : Command
{ {
public DumpMediaCommand() : base("dump-media", "Dumps the media inserted on a device to a media image.") public DumpMediaCommand() : base("dump", "Dumps the media inserted on a device to a media image.")
{ {
Add(new Option(new[] Add(new Option(new[]
{ {

View File

@@ -59,11 +59,11 @@ using DMI = DiscImageChef.Decoders.Xbox.DMI;
using Session = DiscImageChef.Decoders.CD.Session; using Session = DiscImageChef.Decoders.CD.Session;
using Spare = DiscImageChef.Decoders.DVD.Spare; using Spare = DiscImageChef.Decoders.DVD.Spare;
namespace DiscImageChef.Commands namespace DiscImageChef.Commands.Media
{ {
internal class MediaInfoCommand : Command internal class MediaInfoCommand : Command
{ {
public MediaInfoCommand() : base("media-info", "Gets information about the media inserted on a device.") public MediaInfoCommand() : base("info", "Gets information about the media inserted on a device.")
{ {
Add(new Option(new[] Add(new Option(new[]
{ {

View File

@@ -38,11 +38,11 @@ using DiscImageChef.Core;
using DiscImageChef.Core.Devices.Scanning; using DiscImageChef.Core.Devices.Scanning;
using DiscImageChef.Devices; using DiscImageChef.Devices;
namespace DiscImageChef.Commands namespace DiscImageChef.Commands.Media
{ {
internal class MediaScanCommand : Command internal class MediaScanCommand : Command
{ {
public MediaScanCommand() : base("media-scan", "Scans the media inserted on a device.") public MediaScanCommand() : base("scan", "Scans the media inserted on a device.")
{ {
Add(new Option(new[] Add(new Option(new[]
{ {

View File

@@ -57,30 +57,30 @@
<Compile Include="Commands\Database\Statistics.cs" /> <Compile Include="Commands\Database\Statistics.cs" />
<Compile Include="Commands\Database\Update.cs" /> <Compile Include="Commands\Database\Update.cs" />
<Compile Include="Commands\Device\DeviceFamily.cs" /> <Compile Include="Commands\Device\DeviceFamily.cs" />
<Compile Include="Commands\Device\DeviceInfo.cs" /> <Compile Include="Commands\Device\Info.cs" />
<Compile Include="Commands\Device\DeviceReport.cs" /> <Compile Include="Commands\Device\DeviceReport.cs" />
<Compile Include="Commands\Device\ListDevices.cs" /> <Compile Include="Commands\Device\Devices.cs" />
<Compile Include="Commands\Filesystem\ExtractFiles.cs" /> <Compile Include="Commands\Filesystem\ExtractFiles.cs" />
<Compile Include="Commands\Filesystem\FilesystemFamily.cs" /> <Compile Include="Commands\Filesystem\FilesystemFamily.cs" />
<Compile Include="Commands\Filesystem\ListOptions.cs" /> <Compile Include="Commands\Filesystem\Options.cs" />
<Compile Include="Commands\Filesystem\Ls.cs" /> <Compile Include="Commands\Filesystem\Ls.cs" />
<Compile Include="Commands\Formats.cs" /> <Compile Include="Commands\Formats.cs" />
<Compile Include="Commands\Image\Analyze.cs" /> <Compile Include="Commands\Image\Analyze.cs" />
<Compile Include="Commands\Image\Checksum.cs" /> <Compile Include="Commands\Image\Checksum.cs" />
<Compile Include="Commands\Image\Compare.cs" /> <Compile Include="Commands\Image\Compare.cs" />
<Compile Include="Commands\Image\ConvertImage.cs" /> <Compile Include="Commands\Image\Convert.cs" />
<Compile Include="Commands\Image\CreateSidecar.cs" /> <Compile Include="Commands\Image\CreateSidecar.cs" />
<Compile Include="Commands\Image\Decode.cs" /> <Compile Include="Commands\Image\Decode.cs" />
<Compile Include="Commands\Image\Entropy.cs" /> <Compile Include="Commands\Image\Entropy.cs" />
<Compile Include="Commands\Image\ImageFamily.cs" /> <Compile Include="Commands\Image\ImageFamily.cs" />
<Compile Include="Commands\Image\ImageInfo.cs" /> <Compile Include="Commands\Image\Info.cs" />
<Compile Include="Commands\Image\PrintHex.cs" /> <Compile Include="Commands\Image\Print.cs" />
<Compile Include="Commands\Image\Verify.cs" /> <Compile Include="Commands\Image\Verify.cs" />
<Compile Include="Commands\ListNamespaces.cs" /> <Compile Include="Commands\ListNamespaces.cs" />
<Compile Include="Commands\Media\DumpMedia.cs" /> <Compile Include="Commands\Media\Dump.cs" />
<Compile Include="Commands\Media\MediaFamily.cs" /> <Compile Include="Commands\Media\MediaFamily.cs" />
<Compile Include="Commands\Media\MediaInfo.cs" /> <Compile Include="Commands\Media\Info.cs" />
<Compile Include="Commands\Media\MediaScan.cs" /> <Compile Include="Commands\Media\Scan.cs" />
<Compile Include="Commands\Remote.cs" /> <Compile Include="Commands\Remote.cs" />
<Compile Include="Main.cs" /> <Compile Include="Main.cs" />
<Compile Include="Commands\Configure.cs" /> <Compile Include="Commands\Configure.cs" />