Jelajahi Sumber

Implmented argv

arianagiroux 3 minggu lalu
induk
melakukan
b167728624
3 mengubah file dengan 6 tambahan dan 7 penghapusan
  1. 1 2
      Readme.md
  2. 5 3
      cmd/main.go
  3. 0 2
      tui.go

+ 1 - 2
Readme.md

@@ -4,7 +4,6 @@
 ## TODO
 
 - `bug.go:func (b Bug) New(title string, status Field, tags VariadicField, blockedby VariadicField, path string) (bug Bug, err error) { // TODO Implement`
+- `cmd/main.go:// TODO implement interface for browse bugs in folder`
 - `io.go:func WriteBug(bug Bug) (success bool, err error) { return false, nil } // TODO: implement`
 - `io.go:func DeleteBug(bug Bug) (success bool, err error) { return false, nil } // TODO: implement`
-- `tui.go:// TODO Implement Bubbletea`
-- `tui.go:// TODO Replace bug.go implementation of [Bug.View]`

+ 5 - 3
cmd/main.go

@@ -1,5 +1,3 @@
-// TODO implement cli argv defs
-//
 // TODO implement interface for browse bugs in folder
 //
 //	For example:
@@ -13,6 +11,7 @@ package main
 
 import (
 	"buggo"
+	"flag"
 	"fmt"
 	"os"
 
@@ -20,7 +19,10 @@ import (
 )
 
 func main() {
-	bug, _ := buggo.Bug.NewFromPath(buggo.Bug{}, "tests/bugs/test-1") // TODO set via argv
+	flag.Parse()
+	arg := flag.Args()
+
+	bug, _ := buggo.Bug.NewFromPath(buggo.Bug{}, arg[0])
 	p := tea.NewProgram(
 		buggo.Model{Bug: bug},
 		tea.WithAltScreen(), // use the full size of the terminal in its "alternate screen buffer"

+ 0 - 2
tui.go

@@ -1,5 +1,3 @@
-// TODO Implement Bubbletea
-// TODO Replace bug.go implementation of [Bug.View]
 package buggo
 
 import (