mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-04 21:21:49 +00:00
Compare commits
1 Commits
dotnet-too
...
0.17.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
513e59f830 |
@@ -44,6 +44,10 @@ I'm always looking for help or ideas. Please submit code or email with ideas. Un
|
||||
|
||||
## Version Log
|
||||
|
||||
### Version 0.17.1
|
||||
|
||||
* Fix - [Bug Fix for .NET Core on Windows](https://github.com/adamhathcock/sharpcompress/pull/257)
|
||||
|
||||
### Version 0.17.0
|
||||
|
||||
* New - Full LZip support! Can read and write LZip files and Tars inside LZip files. [Make LZip a first class citizen. #241](https://github.com/adamhathcock/sharpcompress/issues/241)
|
||||
|
||||
@@ -13,8 +13,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpCompress", "src\SharpC
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpCompress.Test", "tests\SharpCompress.Test\SharpCompress.Test.csproj", "{F2B1A1EB-0FA6-40D0-8908-E13247C7226F}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dotnet-sharpcompress", "src\dotnet-sharpcompress\dotnet-sharpcompress.csproj", "{CC08976E-8E3B-44EE-BDA7-6A9D2FDDDB02}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -29,10 +27,6 @@ Global
|
||||
{F2B1A1EB-0FA6-40D0-8908-E13247C7226F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F2B1A1EB-0FA6-40D0-8908-E13247C7226F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F2B1A1EB-0FA6-40D0-8908-E13247C7226F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{CC08976E-8E3B-44EE-BDA7-6A9D2FDDDB02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{CC08976E-8E3B-44EE-BDA7-6A9D2FDDDB02}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CC08976E-8E3B-44EE-BDA7-6A9D2FDDDB02}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CC08976E-8E3B-44EE-BDA7-6A9D2FDDDB02}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -40,6 +34,5 @@ Global
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{FD19DDD8-72B2-4024-8665-0D1F7A2AA998} = {3C5BE746-03E5-4895-9988-0B57F162F86C}
|
||||
{F2B1A1EB-0FA6-40D0-8908-E13247C7226F} = {0F0901FF-E8D9-426A-B5A2-17C7F47C1529}
|
||||
{CC08976E-8E3B-44EE-BDA7-6A9D2FDDDB02} = {3C5BE746-03E5-4895-9988-0B57F162F86C}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<PropertyGroup>
|
||||
<AssemblyTitle>SharpCompress - Pure C# Decompression/Compression</AssemblyTitle>
|
||||
<NeutralLanguage>en-US</NeutralLanguage>
|
||||
<VersionPrefix>0.17.0</VersionPrefix>
|
||||
<AssemblyVersion>0.17.0.0</AssemblyVersion>
|
||||
<FileVersion>0.17.0.0</FileVersion>
|
||||
<VersionPrefix>0.17.1</VersionPrefix>
|
||||
<AssemblyVersion>0.17.1.0</AssemblyVersion>
|
||||
<FileVersion>0.17.1.0</FileVersion>
|
||||
<Authors>Adam Hathcock</Authors>
|
||||
<TargetFrameworks Condition="'$(LibraryFrameworks)'==''">net45;net35;netstandard1.0;netstandard1.3</TargetFrameworks>
|
||||
<TargetFrameworks Condition="'$(LibraryFrameworks)'!=''">$(LibraryFrameworks)</TargetFrameworks>
|
||||
@@ -25,4 +25,4 @@
|
||||
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.0' ">
|
||||
<DefineConstants>$(DefineConstants);NO_FILE;NO_CRYPTO;SILVERLIGHT</DefineConstants>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
@@ -1,32 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using CommandLine;
|
||||
|
||||
namespace SharpCompress
|
||||
{
|
||||
public class BaseOptions
|
||||
{
|
||||
[Value(0, Min = 1)]
|
||||
public IEnumerable<string> Path { get; set; }
|
||||
|
||||
protected IEnumerable<FileInfo> GetFilesFromPath()
|
||||
{
|
||||
foreach (var s in Path)
|
||||
{
|
||||
var fileInfo = new FileInfo(s);
|
||||
if (fileInfo.Exists)
|
||||
{
|
||||
yield return fileInfo;
|
||||
}
|
||||
else
|
||||
{
|
||||
using (ConsoleHelper.PushError())
|
||||
{
|
||||
Console.WriteLine($"{s} does not exist");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace SharpCompress
|
||||
{
|
||||
public static class ConsoleHelper
|
||||
{
|
||||
private class ConsoleTextPush : IDisposable
|
||||
{
|
||||
private readonly ConsoleColor _restoreColor;
|
||||
|
||||
public ConsoleTextPush(ConsoleColor displayColor)
|
||||
{
|
||||
_restoreColor = Console.ForegroundColor;
|
||||
Console.ForegroundColor = displayColor;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Console.ForegroundColor = _restoreColor;
|
||||
}
|
||||
}
|
||||
|
||||
public static IDisposable PushForeground(ConsoleColor color)
|
||||
{
|
||||
return new ConsoleTextPush(color);
|
||||
}
|
||||
public static IDisposable PushError()
|
||||
{
|
||||
return PushForeground(ConsoleColor.Red);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
using System;
|
||||
using CommandLine;
|
||||
using SharpCompress.Readers;
|
||||
|
||||
namespace SharpCompress
|
||||
{
|
||||
[Verb("x", HelpText = "Extract an archive")]
|
||||
public class ExtractOptions : BaseOptions
|
||||
{
|
||||
|
||||
[Option('p', HelpText = "Path to extract to")]
|
||||
public string ExtractionPath { get; set; } = AppContext.BaseDirectory;
|
||||
|
||||
public int Process()
|
||||
{
|
||||
foreach (var fileInfo in GetFilesFromPath())
|
||||
{
|
||||
Console.WriteLine($"Extracting archive {fileInfo.FullName} to path: {ExtractionPath}");
|
||||
using (var reader = ReaderFactory.Open(fileInfo.OpenRead()))
|
||||
{
|
||||
while (reader.MoveToNextEntry())
|
||||
{
|
||||
var progress = new ProgressBar();
|
||||
reader.EntryExtractionProgress += (sender, args) =>
|
||||
{
|
||||
progress.Report(args.ReaderProgress.PercentageReadExact);
|
||||
};
|
||||
Console.Write($"Extracting entry {reader.Entry.Key}: ");
|
||||
reader.WriteEntryToDirectory(ExtractionPath);
|
||||
Console.WriteLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
using System;
|
||||
using CommandLine;
|
||||
using SharpCompress.Archives;
|
||||
using SharpCompress.Common;
|
||||
|
||||
namespace SharpCompress
|
||||
{
|
||||
[Verb("i", HelpText = "Information about an archive")]
|
||||
public class InfoOptions : BaseOptions
|
||||
{
|
||||
[Option('e', HelpText = "Show Archive Entry Information")]
|
||||
public bool ShowEntries { get; set; }
|
||||
|
||||
public int Process()
|
||||
{
|
||||
foreach (var fileInfo in GetFilesFromPath())
|
||||
{
|
||||
Console.WriteLine($"=== Archive: {fileInfo}");
|
||||
try
|
||||
{
|
||||
using (var archive = ArchiveFactory.Open(fileInfo.OpenRead()))
|
||||
{
|
||||
Console.WriteLine($"Archive Type: {archive.Type}");
|
||||
|
||||
Console.WriteLine($"Size: {archive.TotalSize}");
|
||||
Console.WriteLine($"Uncompressed Size: {archive.TotalUncompressSize}");
|
||||
|
||||
if (ShowEntries)
|
||||
{
|
||||
foreach (var archiveEntry in archive.Entries)
|
||||
{
|
||||
Console.WriteLine($"\tEntry: {archiveEntry.Key}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (InvalidFormatException)
|
||||
{
|
||||
using (ConsoleHelper.PushError())
|
||||
{
|
||||
Console.WriteLine("Archive Type is unknown.");
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
using (ConsoleHelper.PushError())
|
||||
{
|
||||
Console.WriteLine($"Unhandled Error: {e}");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
using CommandLine;
|
||||
|
||||
namespace SharpCompress
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static int Main(string[] args)
|
||||
{
|
||||
return Parser.Default.ParseArguments<InfoOptions, ExtractOptions>(args)
|
||||
.MapResult(
|
||||
(InfoOptions opts) => opts.Process(),
|
||||
(ExtractOptions opts) => opts.Process(),
|
||||
errs => 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp1.0</TargetFramework>
|
||||
<RootNamespace>SharpCompress</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SharpCompress\SharpCompress.csproj">
|
||||
<Project>{fd19ddd8-72b2-4024-8665-0d1f7a2aa998}</Project>
|
||||
<Name>SharpCompress</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CommandLineParser">
|
||||
<Version>2.1.1-beta</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="goblinfactory.konsole" Version="2.0.2" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user