gooki

package module
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2020 License: MIT Imports: 2 Imported by: 0

README

gooki

list contents of directories in a tree-like format.

Module

Usage
package main

import (
	"os"

	"github.com/masakurapa/gooki"
)

func main() {
	ki, _ := gooki.MakeByDefaultOption(".")
	ki.Write(os.Stdout)
}

Command Line Tool

Installing
$ go get -u github.com/masakurapa/gooki/cmd/gooki
Usage
$ gooki -help

	  _____             _  ___
	 / ____|           | |/ (_)
	| |  __  ___   ___ | ' / _
	| | |_ |/ _ \ / _ \|  < | |
	| |__| | (_) | (_) | . \| |
	 \_____|\___/ \___/|_|\_\_|

Description:
	'gooki' is list contents of directories in a tree-like format.

Synopsis:
	gooki [options...] directory

Options:
  -a	Outputs all files. By default does not hidden files.
  -d	Outputs only directories.
  -f	Outputs full path prefix for each file.
  -help
    	Outputs a usage.
Example
$ gooki
.
├── LICENSE
├── Makefile
├── README.md
├── cmd
│   └── gooki
│       └── main.go
├── go.mod
├── gooki.go
├── internal
│   └── ki
│       ├── interface.go
│       ├── ki.go
│       └── tree_writer.go
└── pkg
    └── gooki
        ├── gooki.go
        └── option.go

5 directories, 10 files

Documentation

Overview

Package gooki はディレクトリの内容をツリー構造で扱うためのモジュールです

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultOption

func DefaultOption() gooki.Option

DefaultOption はデフォルト値を設定したオプションを返します。

func Make

func Make(path string, option gooki.Option) (gooki.Ki, error)

Make はディレクトリツリー情報を生成します。

Example
package main

import (
	"os"

	"github.com/masakurapa/gooki"
)

func main() {
	ki, err := gooki.Make("./testdata", gooki.DefaultOption())
	if err != nil {
		panic(err)
	}
	ki.Write(os.Stdout)
}
Output:

./testdata
├── example.txt
├── path1
│   ├── to.txt
│   ├── to1
│   │   ├── file1.go
│   │   └── file2.go
│   └── to2
│       └── sample.txt
├── path2
│   ├── example1.go
│   └── example1_test.go
└── symlink.txt -> example.txt

4 directories, 8 files

func MakeByDefaultOption added in v0.2.0

func MakeByDefaultOption(path string) (gooki.Ki, error)

MakeByDefaultOption はデフォルトのオプションでディレクトリツリー情報を生成します。

Example
package main

import (
	"os"

	"github.com/masakurapa/gooki"
)

func main() {
	ki, err := gooki.MakeByDefaultOption("./testdata")
	if err != nil {
		panic(err)
	}
	ki.Write(os.Stdout)
}
Output:

./testdata
├── example.txt
├── path1
│   ├── to.txt
│   ├── to1
│   │   ├── file1.go
│   │   └── file2.go
│   └── to2
│       └── sample.txt
├── path2
│   ├── example1.go
│   └── example1_test.go
└── symlink.txt -> example.txt

4 directories, 8 files

Types

This section is empty.

Directories

Path Synopsis
cmd
gooki
Package gooki はディレクトリの内容をツリー構造で出力するコマンドラインツールです
Package gooki はディレクトリの内容をツリー構造で出力するコマンドラインツールです
internal
ki
pkg
gooki
Package gooki はツリー構造を作るためのインタフェース、オプションを扱うパッケージです
Package gooki はツリー構造を作るためのインタフェース、オプションを扱うパッケージです

Jump to

Keyboard shortcuts

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