zlook

package module
v0.0.0-...-502807f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

README

zlook

List entries or extract entry from nested zip archive to any configurable depth

Installation

Usage Help

Usage of zlook:
  -d int
    	Maximum Depth to which to inspect archive (default 1)
  -p	Prefix Parent Path (default true)
  -t value
    	Comma Separated Archive Types (default [.zip .esa .jar])
  -x string
    	Extract matching entry (suffix match) to stdout

Examples

Download a nested zip archive [simple-ear[(http://repo1.maven.org/maven2/org/codehaus/cargo/simple-ear/1.6.7/simple-ear-1.6.7.ear) from maven repo

List Entries
> zlook ~/Downloads/simple-ear-1.6.7.ear  
META-INF/MANIFEST.MF
META-INF/application.xml
simple-war-1.6.7.war
simple-war-1.6.7.war/META-INF/MANIFEST.MF
simple-war-1.6.7.war/index.jsp
simple-war-1.6.7.war/WEB-INF/web.xml
simple-war-1.6.7.war/META-INF/maven/org.codehaus.cargo/simple-war/pom.xml
simple-war-1.6.7.war/META-INF/maven/org.codehaus.cargo/simple-war/pom.properties
META-INF/maven/org.codehaus.cargo/simple-ear/pom.xml
META-INF/maven/org.codehaus.cargo/simple-ear/pom.properties

Extract Entry To Stdout

>zlook -x simple-war/pom.properties ~/Downloads/simple-ear-1.6.7.ear                
#Generated by Maven
#Sat Mar 03 14:42:01 CET 2018
version=1.6.7
groupId=org.codehaus.cargo
artifactId=simple-war

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultArchiveTypes = []string{".zip", ".esa", ".jar", ".ear", ".war"}

DefaultArchiveTypes represents the default collection of file extensions treaated as archives

Functions

This section is empty.

Types

type FileExtensions

type FileExtensions []string

FileExtensions represents a collection of file extensions (zip/gz, etc) as a slice of strings

func (*FileExtensions) Set

func (t *FileExtensions) Set(value string) error

Set the value of FileExtensions

func (*FileExtensions) String

func (t *FileExtensions) String() string

Get the value of FileExtensions

type Input

type Input struct {
	MaxDepth     int
	ArchiveTypes FileExtensions
	PrefixPath   bool
	ExtractEntry string
	Paths        []string
}

An Input represents the input to zlook that consists of a slice of files to look at and depth to which looking must be done

type Inspector

type Inspector interface {
	List() error
	Extract() error
}

Inspector provides operators inspecting the contents of archives as configured in Input

func NewInspector

func NewInspector(in Input) Inspector

NewInspector constructs, initizlies and returns an Inspector from Input

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL