added tiny basic ls implimentation, doesnt take any args other than the directory to list, doesnt even jsonify the output, literally bare bonest ls to make sure I can do the backend part of ls

This commit is contained in:
Sam Abradi 2014-09-03 14:21:21 -04:00
parent 56437f6bfa
commit 865feb3584

22
ls.go Normal file
View File

@ -0,0 +1,22 @@
package main
import (
"io/ioutil"
"fmt"
// "encoding/json"
// "os"
"flag"
)
func main() {
//dec := json.NewDecoder(os.Stdin)
//enc := json.NewEncoder(os.Stdout)
flag.Parse()
root := flag.Arg(0)
dir,_ := ioutil.ReadDir(root)
for _,entry := range dir{
fmt.Printf("%s\n", entry.Name())
}
}