feat: added the "bb ls -R" flag.
This commit is contained in:
parent
702e8e05af
commit
d286351445
1 changed files with 9 additions and 2 deletions
|
@ -126,17 +126,24 @@ ls(p string, fold int) error {
|
|||
|
||||
func Run(flagSet *mtool.Flags) {
|
||||
var foldLvl int
|
||||
flagSet.IntVar(&foldLvl, "r", 1, "List recursively with choosing deepness, can't be negative or zero.")
|
||||
flagSet.BoolVar(&listHidden, "a", false, "List hidden files.")
|
||||
var rFlag bool
|
||||
flagSet.BoolVar(&rFlag, "R", false, "set the '-r' flags value to the max depth (overrides the '-r')")
|
||||
flagSet.IntVar(&foldLvl, "r", 1, "list recursively with choosing deepness, can't be negative or zero.")
|
||||
flagSet.BoolVar(&listHidden, "a", false, "list hidden files.")
|
||||
flagSet.Parse()
|
||||
args = flagSet.Args()
|
||||
|
||||
if rFlag {
|
||||
foldLvl = 9999999
|
||||
}
|
||||
if foldLvl<0 {
|
||||
flagSet.Usage()
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
if foldLvl==0 && len(args)==0 {
|
||||
flagSet.Usage()
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
if len(args) == 0 {
|
||||
|
|
Loading…
Reference in a new issue