aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--go.mod5
-rw-r--r--go.sum4
-rw-r--r--sd.go15
3 files changed, 22 insertions, 2 deletions
diff --git a/go.mod b/go.mod
index 94d9d02..fda4565 100644
--- a/go.mod
+++ b/go.mod
@@ -1,3 +1,8 @@
module sd
go 1.18
+
+require (
+ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 // indirect
+ golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
+)
diff --git a/go.sum b/go.sum
new file mode 100644
index 0000000..26b086d
--- /dev/null
+++ b/go.sum
@@ -0,0 +1,4 @@
+golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 h1:SrN+KX8Art/Sf4HNj6Zcz06G7VEz+7w9tdXTPOZ7+l4=
+golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY=
+golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
diff --git a/sd.go b/sd.go
index 52a7925..5480499 100644
--- a/sd.go
+++ b/sd.go
@@ -1,9 +1,20 @@
package main
import (
- "fmt"
+ "flag"
+ "os"
+
+ "golang.org/x/term"
)
+var file = flag.String("f", "cards", "cards file")
+
func main() {
- fmt.Println("hello world")
+ flag.Parse()
+
+ oldState, err := term.MakeRaw(int(os.Stdin.Fd()))
+ if err != nil {
+ panic(err)
+ }
+ defer term.Restore(int(os.Stdin.Fd()), oldState)
}