package main

import (
	"fmt"
	"log"
	"os"
	"reflect"
)

func main() {
	var flag bool
	var file os.File
	path := os.Args[1]

	if len(os.Args) == 3 && os.Args[2] == "-f" {
		flag = true
	}

	// fmt.Println(path)
	fmt.Println(flag)

	entries, err := os.ReadDir(path)

	fmt.Println(reflect.TypeOf(entries))
	fmt.Printf("Type: %T\n", entries)

	if err != nil {
		log.Fatal(err)
	}

	for _, e := range entries {
		fmt.Println(e.Name())
	}

	/*
		// if len(os.Args) ==
		fmt.Println(os.Args[0])
		fmt.Println(os.Args[1])
		fmt.Println(os.Args[2])
	*/
	/*
		argsWithProg := os.Args
		argsWithoutProg := os.Args[1:]

		arg := os.Args[3]

		fmt.Println(argsWithProg)
		fmt.Println(argsWithoutProg)
		fmt.Println(arg)
		fmt.Println(os.Args[1])
	*/
	/*


		wordPtr := flag.String("word", "foo", "a string")
		numbPtr := flag.Int("numb", 42, "an int")
		boolPtr := flag.Bool("fork", false, "a bool")

		var svar string
		flag.StringVar(&svar, "svar", "bar", "a string var")

		flag.Parse()



		fmt.Println("word:", *wordPtr)
		fmt.Println("numb:", *numbPtr)
		fmt.Println("fork:", *boolPtr)
		fmt.Println("svar:", svar)
		fmt.Println("tail:", flag.Args())
	*/
}
