galadh

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2020 License: BSD-2-Clause Imports: 8 Imported by: 0

README

galadh

A simple tree clone in go. (galadh is the word for tree in Sindarin see Elfdict)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Galadh

type Galadh struct {
	// contains filtered or unexported fields
}

Galadh is simple clone of the posix tree command.

func NewGaladh

func NewGaladh(options ...Options) *Galadh

NewGaladh returns a new Galadh tree viewer. It takes arbitrary options, but doesn't need any.

func (Galadh) PrintTree

func (g Galadh) PrintTree(path string) error

PrintTree prints a tree according the configured options for the passed directory.

type Options

type Options func(g *Galadh)

Options is a function that configures the Galadh instance.

func UseASCIIGlyphs

func UseASCIIGlyphs(b bool) Options

UseASCIIGlyphs configures whether to use ASCII glyphs or not.

func UseAllFiles

func UseAllFiles(b bool) Options

UseAllFiles configures whether to include also hidden files.

func UseColors

func UseColors(b bool) Options

UseColors configures whether to use colorized output or not.

func UseDirOnly

func UseDirOnly(b bool) Options

UseDirOnly configures whether

func UseExcludePattern

func UseExcludePattern(pattern string) Options

UseExcludePattern configures which files should be excluded.

func UseHumanReadableSize

func UseHumanReadableSize(b bool) Options

UseHumanReadableSize configures whether to display file size in bytes or human readable units.

func UseIgnoreCase

func UseIgnoreCase(b bool) Options

UseIgnoreCase configures whether pattern matching ignore casing.

func UseIncludePattern

func UseIncludePattern(pattern string) Options

UseIncludePattern configures which files should be included.

func UseMatchDirs

func UseMatchDirs(b bool) Options

UseMatchDirs configures if the pattern matches also applies for directories. If a pattern matches for a directory, then all files and folders in that directory will be printed as well.

func UseMaxLevel

func UseMaxLevel(lvl int) Options

UseMaxLevel configures how deep the recursion of the tree will be. If -1 is used, the recursion has no limits.

func UseOutput

func UseOutput(writer io.Writer) Options

UseOutput configures to print output to the specified writer. This options disables colorization and can't be overriden by UseColors.

func UsePrintFullPath

func UsePrintFullPath(b bool) Options

UsePrintFullPath configures whether the full path should be displayed.

func UseReplaceNonPrintableChars

func UseReplaceNonPrintableChars(b bool) Options

UseReplaceNonPrintableChars to configure to replace non printable characters.

func UseSize

func UseSize(b bool) Options

UseSize configures whether to print size of a file or not.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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