added flag to set resursive depth for console output
This commit is contained in:
parent
c4870bfe0d
commit
37ee30ec03
24
.gitignore
vendored
24
.gitignore
vendored
@ -1,24 +1,2 @@
|
|||||||
# ---> Go
|
|
||||||
# If you prefer the allow list template instead of the deny list, see community template:
|
|
||||||
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
|
|
||||||
#
|
|
||||||
# Binaries for programs and plugins
|
|
||||||
*.exe
|
|
||||||
*.exe~
|
|
||||||
*.dll
|
|
||||||
*.so
|
|
||||||
*.dylib
|
|
||||||
|
|
||||||
# Test binary, built with `go test -c`
|
|
||||||
*.test
|
|
||||||
|
|
||||||
# Output of the go coverage tool, specifically when used with LiteIDE
|
|
||||||
*.out
|
|
||||||
|
|
||||||
# Dependency directories (remove the comment below to include it)
|
|
||||||
# vendor/
|
|
||||||
|
|
||||||
# Go workspace file
|
|
||||||
go.work
|
|
||||||
|
|
||||||
diskspace
|
diskspace
|
||||||
|
output
|
@ -32,7 +32,7 @@ func ls(args []string) {
|
|||||||
|
|
||||||
for _, entry := range entries {
|
for _, entry := range entries {
|
||||||
fmt.Println()
|
fmt.Println()
|
||||||
fmt.Println(entry.StringRecursive(1))
|
fmt.Println(entry.StringRecursive(*RecursiveDirDepth))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
main.go
4
main.go
@ -25,8 +25,8 @@ var (
|
|||||||
ColorGreen = color.New(color.FgGreen)
|
ColorGreen = color.New(color.FgGreen)
|
||||||
|
|
||||||
IconTheme = flag.String("i", "unicode", "icon theme (currently supported: default, unicode, nerd)")
|
IconTheme = flag.String("i", "unicode", "icon theme (currently supported: default, unicode, nerd)")
|
||||||
|
|
||||||
ShowVersion = flag.Bool("v", false, "show version and exit")
|
ShowVersion = flag.Bool("v", false, "show version and exit")
|
||||||
|
RecursiveDirDepth = flag.Int("d", 1, "depth for recursively printing files of directories")
|
||||||
)
|
)
|
||||||
|
|
||||||
// FIXME sometimes sorting not applied after removing items
|
// FIXME sometimes sorting not applied after removing items
|
||||||
@ -83,7 +83,7 @@ func main() {
|
|||||||
showCurrentDir := true
|
showCurrentDir := true
|
||||||
for {
|
for {
|
||||||
if showCurrentDir {
|
if showCurrentDir {
|
||||||
fmt.Println(Current.StringRecursive(1))
|
fmt.Println(Current.StringRecursive(*RecursiveDirDepth))
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Print("> ")
|
fmt.Print("> ")
|
||||||
|
Loading…
Reference in New Issue
Block a user