feat: Completed functionality for generating a period timeline

This commit is contained in:
Ethan Holz
2022-10-14 14:17:50 -05:00
parent 9698d90308
commit 8612f90d46
4 changed files with 213 additions and 25 deletions

14
main.go
View File

@@ -4,6 +4,7 @@ import (
"bufio"
"flag"
"fmt"
"log"
"os"
"strings"
"time"
@@ -20,9 +21,11 @@ type Period struct {
func (p Period) GetEndTime() time.Time {
return p.EndTime
}
func (p Period) GetStartTime() time.Time {
return p.StartTime
}
func (p Period) GetIdentifier() string {
return p.Identifier
}
@@ -33,13 +36,18 @@ func init() {
flag.PrintDefaults()
}
}
func warnMessage() {
fmt.Print("Please type your date formats as follows, hit return between each field (RFC 3339), and hit Control+D to signal you are complete: \nIdentifier: id\nStartTime: 2019-10-12T07:20:50.52Z\nEndTime: 2019-10-12T07:20:50.52Z\n")
}
func main() {
help := flag.Bool("h", false, "displays help command")
flag.Parse()
if *help {
fmt.Println("Help goes here")
os.Exit(0)
}
terminal := false
fi, _ := os.Stdin.Stat()
if (fi.Mode() & os.ModeCharDevice) == 0 {
@@ -107,4 +115,8 @@ func main() {
fmt.Printf("\nThe MSP from the list was: ")
}
fmt.Printf("%s\n", m)
vals := msp.GenerateTimeline(periods...)
for _, val := range vals {
log.Print(val)
}
}