bbash/command/ls/ls.go
Tobias P.L Wennberg 15eeadf5d3 initial
2025-01-10 13:29:56 +01:00

22 lines
322 B
Go

package ls
import (
"bbash/environment"
"bbash/input_parser"
"fmt"
"os"
)
func Ls(in input_parser.Input, env *environment.Env) {
fs, err := os.ReadDir(env.Path)
if err != nil {
fmt.Print(fmt.Sprintf("Error opening directory %s", env.Path))
}
for _, f := range fs {
fmt.Print(f.Name())
fmt.Println()
}
}