From 542520f5cd5c4bd7cecd28f0d46f240fdc552a1d Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Wed, 20 Dec 2017 02:16:11 +0000 Subject: [PATCH] REFACTOR: CommandLine wants member to be public, disable ReSharper rule. --- DiscImageChef/Options.cs | 198 ++++++++++++++++++++------------------- 1 file changed, 100 insertions(+), 98 deletions(-) diff --git a/DiscImageChef/Options.cs b/DiscImageChef/Options.cs index 3456b0f0..2ef1a3ed 100644 --- a/DiscImageChef/Options.cs +++ b/DiscImageChef/Options.cs @@ -14,16 +14,16 @@ // --[ License ] -------------------------------------------------------------- // // This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General internal License as +// it under the terms of the GNU General public License as // published by the Free Software Foundation, either version 3 of the // License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General internal License for more details. +// GNU General public License for more details. // -// You should have received a copy of the GNU General internal License +// You should have received a copy of the GNU General public License // along with this program. If not, see . // // ---------------------------------------------------------------------------- @@ -31,319 +31,321 @@ // ****************************************************************************/ using CommandLine; +// ReSharper disable MemberCanBeInternal +// ReSharper disable UnusedAutoPropertyAccessor.Global namespace DiscImageChef { - internal abstract class CommonOptions + public abstract class CommonOptions { [Option('v', "verbose", Default = false, HelpText = "Shows verbose output")] - internal bool Verbose { get; set; } + public bool Verbose { get; set; } [Option('d', "debug", Default = false, HelpText = "Shows debug output from plugins")] - internal bool Debug { get; set; } + public bool Debug { get; set; } } [Verb("analyze", HelpText = "Analyzes a disc image and searches for partitions and/or filesystems.")] - class AnalyzeOptions : CommonOptions + public class AnalyzeOptions : CommonOptions { [Option('p', "partitions", Default = true, HelpText = "Searches and interprets partitions.")] - internal bool SearchForPartitions { get; set; } + public bool SearchForPartitions { get; set; } [Option('f', "filesystems", Default = true, HelpText = "Searches and interprets partitions.")] - internal bool SearchForFilesystems { get; set; } + public bool SearchForFilesystems { get; set; } [Option('i', "input", Required = true, HelpText = "Disc image.")] - internal string InputFile { get; set; } + public string InputFile { get; set; } [Option('e', "encoding", Default = null, HelpText = "Name of character encoding to use.")] - internal string EncodingName { get; set; } + public string EncodingName { get; set; } } [Verb("compare", HelpText = "Compares two disc images.")] - class CompareOptions : CommonOptions + public class CompareOptions : CommonOptions { [Option("input1", Required = true, HelpText = "First disc image.")] - internal string InputFile1 { get; set; } + public string InputFile1 { get; set; } [Option("input2", Required = true, HelpText = "Second disc image.")] - internal string InputFile2 { get; set; } + public string InputFile2 { get; set; } } [Verb("checksum", HelpText = "Checksums an image.")] - class ChecksumOptions : CommonOptions + public class ChecksumOptions : CommonOptions { [Option('t', "separated-tracks", Default = true, HelpText = "Checksums each track separately.")] - internal bool SeparatedTracks { get; set; } + public bool SeparatedTracks { get; set; } [Option('w', "whole-disc", Default = true, HelpText = "Checksums the whole disc.")] - internal bool WholeDisc { get; set; } + public bool WholeDisc { get; set; } [Option('a', "adler32", Default = true, HelpText = "Calculates Adler-32.")] - internal bool DoAdler32 { get; set; } + public bool DoAdler32 { get; set; } [Option("crc16", Default = true, HelpText = "Calculates CRC16.")] - internal bool DoCRC16 { get; set; } + public bool DoCRC16 { get; set; } [Option('c', "crc32", Default = true, HelpText = "Calculates CRC32.")] - internal bool DoCRC32 { get; set; } + public bool DoCRC32 { get; set; } [Option("crc64", Default = false, HelpText = "Calculates CRC64 (ECMA).")] - internal bool DoCRC64 { get; set; } + public bool DoCRC64 { get; set; } /*[Option("fletcher16", Default = false, HelpText = "Calculates Fletcher-16.")] - internal bool DoFletcher16 { get; set; } + public bool DoFletcher16 { get; set; } [Option("fletcher32", Default = false, HelpText = "Calculates Fletcher-32.")] - internal bool DoFletcher32 { get; set; }*/ + public bool DoFletcher32 { get; set; }*/ [Option('m', "md5", Default = true, HelpText = "Calculates MD5.")] - internal bool DoMD5 { get; set; } + public bool DoMD5 { get; set; } [Option("ripemd160", Default = false, HelpText = "Calculates RIPEMD160.")] - internal bool DoRIPEMD160 { get; set; } + public bool DoRIPEMD160 { get; set; } [Option('s', "sha1", Default = true, HelpText = "Calculates SHA1.")] - internal bool DoSHA1 { get; set; } + public bool DoSHA1 { get; set; } [Option("sha256", Default = false, HelpText = "Calculates SHA256.")] - internal bool DoSHA256 { get; set; } + public bool DoSHA256 { get; set; } [Option("sha384", Default = false, HelpText = "Calculates SHA384.")] - internal bool DoSHA384 { get; set; } + public bool DoSHA384 { get; set; } [Option("sha512", Default = false, HelpText = "Calculates SHA512.")] - internal bool DoSHA512 { get; set; } + public bool DoSHA512 { get; set; } [Option('f', "spamsum", Default = true, HelpText = "Calculates SpamSum fuzzy hash.")] - internal bool DoSpamSum { get; set; } + public bool DoSpamSum { get; set; } [Option('i', "input", Required = true, HelpText = "Disc image.")] - internal string InputFile { get; set; } + public string InputFile { get; set; } } [Verb("entropy", HelpText = "Calculates entropy and/or duplicated sectors of an image.")] - class EntropyOptions : CommonOptions + public class EntropyOptions : CommonOptions { [Option('p', "duplicated-sectors", Default = true, HelpText = "Calculates how many sectors are duplicated (have same exact data in user area).")] - internal bool DuplicatedSectors { get; set; } + public bool DuplicatedSectors { get; set; } [Option('t', "separated-tracks", Default = true, HelpText = "Calculates entropy for each track separately.")] - internal bool SeparatedTracks { get; set; } + public bool SeparatedTracks { get; set; } [Option('w', "whole-disc", Default = true, HelpText = "Calculates entropy for the whole disc.")] - internal bool WholeDisc { get; set; } + public bool WholeDisc { get; set; } [Option('i', "input", Required = true, HelpText = "Disc image.")] - internal string InputFile { get; set; } + public string InputFile { get; set; } } [Verb("verify", HelpText = "Verifies a disc image integrity, and if supported, sector integrity.")] - class VerifyOptions : CommonOptions + public class VerifyOptions : CommonOptions { [Option('w', "verify-disc", Default = true, HelpText = "Verify disc image if supported.")] - internal bool VerifyDisc { get; set; } + public bool VerifyDisc { get; set; } [Option('s', "verify-sectors", Default = true, HelpText = "Verify all sectors if supported.")] - internal bool VerifySectors { get; set; } + public bool VerifySectors { get; set; } [Option('i', "input", Required = true, HelpText = "Disc image.")] - internal string InputFile { get; set; } + public string InputFile { get; set; } } [Verb("printhex", HelpText = "Prints a sector, in hexadecimal values, to the console.")] - class PrintHexOptions : CommonOptions + public class PrintHexOptions : CommonOptions { [Option('s', "start", Required = true, HelpText = "Start sector.")] - internal ulong StartSector { get; set; } + public ulong StartSector { get; set; } [Option('l', "length", Default = (ulong)1, HelpText = "How many sectors to print.")] - internal ulong Length { get; set; } + public ulong Length { get; set; } [Option('r', "long-sectors", Default = false, HelpText = "Print sectors with tags included.")] - internal bool LongSectors { get; set; } + public bool LongSectors { get; set; } [Option('w', "width", Default = (ushort)32, HelpText = "How many bytes to print per line.")] - internal ushort WidthBytes { get; set; } + public ushort WidthBytes { get; set; } [Option('i', "input", Required = true, HelpText = "Disc image.")] - internal string InputFile { get; set; } + public string InputFile { get; set; } } [Verb("decode", HelpText = "Decodes and pretty prints disk and/or sector tags.")] - class DecodeOptions : CommonOptions + public class DecodeOptions : CommonOptions { [Option('s', "start", Default = (ulong)0, HelpText = "Start sector.")] - internal ulong StartSector { get; set; } + public ulong StartSector { get; set; } [Option('l', "length", Default = "all", HelpText = "How many sectors to decode, or \"all\".")] - internal string Length { get; set; } + public string Length { get; set; } [Option('k', "disk-tags", Default = true, HelpText = "Decode disk tags.")] - internal bool DiskTags { get; set; } + public bool DiskTags { get; set; } [Option('t', "sector-tags", Default = true, HelpText = "Decode sector tags.")] - internal bool SectorTags { get; set; } + public bool SectorTags { get; set; } [Option('i', "input", Required = true, HelpText = "Disc image.")] - internal string InputFile { get; set; } + public string InputFile { get; set; } } [Verb("device-info", HelpText = "Gets information about a device.")] - class DeviceInfoOptions : CommonOptions + public class DeviceInfoOptions : CommonOptions { [Option('i', "device", Required = true, HelpText = "Device path.")] - internal string DevicePath { get; set; } + public string DevicePath { get; set; } [Option('w', "output-prefix", Required = false, Default = "", HelpText = "Write binary responses from device with that prefix.")] - internal string OutputPrefix { get; set; } + public string OutputPrefix { get; set; } } [Verb("media-info", HelpText = "Gets information about the media inserted on a device.")] - class MediaInfoOptions : CommonOptions + public class MediaInfoOptions : CommonOptions { [Option('i', "device", Required = true, HelpText = "Device path.")] - internal string DevicePath { get; set; } + public string DevicePath { get; set; } [Option('w', "output-prefix", Required = false, Default = "", HelpText = "Write binary responses from device with that prefix.")] - internal string OutputPrefix { get; set; } + public string OutputPrefix { get; set; } } [Verb("media-scan", HelpText = "Scans the media inserted on a device.")] - class MediaScanOptions : CommonOptions + public class MediaScanOptions : CommonOptions { [Option('i', "device", Required = true, HelpText = "Device path.")] - internal string DevicePath { get; set; } + public string DevicePath { get; set; } [Option('m', "mhdd-log", Required = false, Default = "", HelpText = "Write a log of the scan in the format used by MHDD.")] - internal string MHDDLogPath { get; set; } + public string MHDDLogPath { get; set; } [Option('b', "ibg-log", Required = false, Default = "", HelpText = "Write a log of the scan in the format used by ImgBurn.")] - internal string IBGLogPath { get; set; } + public string IBGLogPath { get; set; } } [Verb("formats", HelpText = "Lists all supported disc images, partition schemes and file systems.")] - class FormatsOptions : CommonOptions { } + public class FormatsOptions : CommonOptions { } [Verb("benchmark", HelpText = "Benchmarks hashing and entropy calculation.")] - class BenchmarkOptions : CommonOptions + public class BenchmarkOptions : CommonOptions { [Option('b', "block-size", Required = false, Default = 512, HelpText = "Block size.")] - internal int BlockSize { get; set; } + public int BlockSize { get; set; } [Option('s', "buffer-size", Required = false, Default = 128, HelpText = "Buffer size in mebibytes.")] - internal int BufferSize { get; set; } + public int BufferSize { get; set; } } [Verb("create-sidecar", HelpText = "Creates CICM Metadata XML sidecar.")] - class CreateSidecarOptions : CommonOptions + public class CreateSidecarOptions : CommonOptions { [Option('i', "input", Required = true, HelpText = "Disc image.")] - internal string InputFile { get; set; } + public string InputFile { get; set; } [Option('t', "tape", Required = false, Default = false, HelpText = "When used indicates that input is a folder containing alphabetically sorted files extracted from a linear block-based tape with fixed block size (e.g. a SCSI tape device).")] - internal bool Tape { get; set; } + public bool Tape { get; set; } [Option('b', "block-size", Required = false, Default = 512, HelpText = "Only used for tapes, indicates block size. Files in the folder whose size is not a multiple of this value will simply be ignored.")] - internal int BlockSize { get; set; } + public int BlockSize { get; set; } [Option('e', "encoding", Default = null, HelpText = "Name of character encoding to use.")] - internal string EncodingName { get; set; } + public string EncodingName { get; set; } } [Verb("dump-media", HelpText = "Dumps the media inserted on a device to a media image.")] - class DumpMediaOptions : CommonOptions + public class DumpMediaOptions : CommonOptions { [Option('i', "device", Required = true, HelpText = "Device path.")] - internal string DevicePath { get; set; } + public string DevicePath { get; set; } [Option('w', "output-prefix", Required = true, HelpText = "Prefix for media dump.")] - internal string OutputPrefix { get; set; } + public string OutputPrefix { get; set; } [Option('r', "raw", Default = false, HelpText = "Dump sectors with tags included. For optical media, dump scrambled sectors")] - internal bool Raw { get; set; } + public bool Raw { get; set; } [Option('s', "stop-on-error", Default = false, HelpText = "Stop media dump on first error.")] - internal bool StopOnError { get; set; } + public bool StopOnError { get; set; } [Option('f', "force", Default = false, HelpText = "Continue dump whatever happens.")] - internal bool Force { get; set; } + public bool Force { get; set; } [Option('p', "retry-passes", Default = (ushort)5, HelpText = "How many retry passes to do.")] - internal ushort RetryPasses { get; set; } + public ushort RetryPasses { get; set; } [Option("persistent", Default = false, HelpText = "Try to recover partial or incorrect data.")] - internal bool Persistent { get; set; } + public bool Persistent { get; set; } [Option("separate-subchannel", Default = false, HelpText = "Save subchannel in a separate file. Only applicable to CD/DDCD/GD.")] - internal bool SeparateSubchannel { get; set; } + public bool SeparateSubchannel { get; set; } [Option('m', "resume", Default = true, HelpText = "Create/use resume mapfile.")] - internal bool Resume { get; set; } + public bool Resume { get; set; } [Option("lead-in", Default = false, HelpText = "Try to read lead-in. Only applicable to CD/DDCD/GD.")] - internal bool LeadIn { get; set; } + public bool LeadIn { get; set; } [Option('e', "encoding", Default = null, HelpText = "Name of character encoding to use.")] - internal string EncodingName { get; set; } + public string EncodingName { get; set; } } [Verb("device-report", HelpText = "Tests the device capabilities and creates an XML report of them.")] - class DeviceReportOptions : CommonOptions + public class DeviceReportOptions : CommonOptions { [Option('i', "device", Required = true, HelpText = "Device path.")] - internal string DevicePath { get; set; } + public string DevicePath { get; set; } } [Verb("configure", HelpText = "Configures user settings and statistics.")] - class ConfigureOptions { } + public class ConfigureOptions { } [Verb("stats", HelpText = "Shows statistics.")] - class StatsOptions { } + public class StatsOptions { } [Verb("ls", HelpText = "Lists files in disc image.")] - class LsOptions : CommonOptions + public class LsOptions : CommonOptions { [Option('i', "input", Required = true, HelpText = "Disc image.")] - internal string InputFile { get; set; } + public string InputFile { get; set; } [Option('l', "long", Default = false, HelpText = "Uses long format.")] - internal bool Long { get; set; } + public bool Long { get; set; } [Option('e', "encoding", Default = null, HelpText = "Name of character encoding to use.")] - internal string EncodingName { get; set; } + public string EncodingName { get; set; } } [Verb("extract-files", HelpText = "Extracts all files in disc image.")] - class ExtractFilesOptions : CommonOptions + public class ExtractFilesOptions : CommonOptions { [Option('i', "input", Required = true, HelpText = "Disc image.")] - internal string InputFile { get; set; } + public string InputFile { get; set; } [Option('o', "output", Required = true, HelpText = "Directory where extracted files will be created. Will abort if it exists.")] - internal string OutputDir { get; set; } + public string OutputDir { get; set; } [Option('x', "xattrs", Default = false, HelpText = "Extract extended attributes if present.")] - internal bool Xattrs { get; set; } + public bool Xattrs { get; set; } [Option('e', "encoding", Default = null, HelpText = "Name of character encoding to use.")] - internal string EncodingName { get; set; } + public string EncodingName { get; set; } } [Verb("list-devices", HelpText = "Lists all connected devices.")] - class ListDevicesOptions : CommonOptions { } + public class ListDevicesOptions : CommonOptions { } [Verb("list-encodings", HelpText = "Lists all supported text encodings and code pages.")] - class ListEncodingsOptions : CommonOptions { } + public class ListEncodingsOptions : CommonOptions { } } \ No newline at end of file