diff --git a/tool/ls/ls.go b/tool/ls/ls.go index 132d3a9..943e83a 100644 --- a/tool/ls/ls.go +++ b/tool/ls/ls.go @@ -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 {