File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -32,9 +32,13 @@ type Config struct {
3232}
3333
3434func Main () {
35+ configFlag := flag .String ("config" , "config.yaml" , "Config file" )
36+ startFlag := flag .String ("start" , "" , "Start date of period to extract from electric co." )
37+ endFlag := flag .String ("end" , "" , "End date of period to extract from electric co." )
38+ flag .Parse ()
3539
3640 // read config
37- file , err := os .ReadFile ("config.yaml" )
41+ file , err := os .ReadFile (* configFlag )
3842 if err != nil {
3943 log .Fatal (err )
4044 }
@@ -47,10 +51,6 @@ func Main() {
4751 log .Fatal ("ExtractDays must be between 2 and 45 per smarthub" )
4852 }
4953
50- // parse time flags
51- startFlag := flag .String ("start" , "" , "Start date of period to extract from electric co." )
52- endFlag := flag .String ("end" , "" , "End date of period to extract from electric co." )
53- flag .Parse ()
5454 var startDate , endDate time.Time
5555 if * startFlag != "" {
5656 startDate , err = time .ParseInLocation ("2006-01-02" , * startFlag , time .Local )
You can’t perform that action at this time.
0 commit comments