ls : lll fix multiple targets.
This commit is contained in:
parent
e9662005f3
commit
1ba877a029
|
@ -534,7 +534,7 @@ Command|Description
|
||||||
---|---
|
---|---
|
||||||
`l`|List files in current dir.
|
`l`|List files in current dir.
|
||||||
`ll`|List including hidden files.
|
`ll`|List including hidden files.
|
||||||
`lll [DEPTH] [PATH]`|Show file tree.
|
`lll [DEPTH] [DIRS]`|Show file tree.
|
||||||
`llll`|List everything recursively.
|
`llll`|List everything recursively.
|
||||||
`la`|List alphabetically.
|
`la`|List alphabetically.
|
||||||
`laa`|List all alphabetically.
|
`laa`|List all alphabetically.
|
||||||
|
|
|
@ -15,21 +15,17 @@ ll()
|
||||||
}
|
}
|
||||||
|
|
||||||
# list files in tree structure.
|
# list files in tree structure.
|
||||||
# usage: lll [DEPTH] [FILES]
|
# usage: lll [DEPTH] [DIRS]
|
||||||
lll()
|
lll()
|
||||||
{
|
{
|
||||||
|
local IFS=$'\n'
|
||||||
local depth="${1}"
|
local depth="${1}"
|
||||||
local target="${@:2}"
|
local target=("${@:2}")
|
||||||
|
|
||||||
if [[ "${target}" = "" ]]; then
|
[[ "${target}" = "" ]] && target="."
|
||||||
target="."
|
[[ "${depth}" = "" ]] && depth=666
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "${depth}" = "" ]]; then
|
tree -a -L "${depth}" -- "${target[@]}"
|
||||||
tree -a -- "${target}"
|
|
||||||
else
|
|
||||||
tree -a -L "${depth}" -- "${target}"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# list files recursively.
|
# list files recursively.
|
||||||
|
|
Reference in a new issue