22 lines
322 B
Go
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()
|
|
}
|
|
}
|
|
|
|
|