diff options
| author | Jeff Carr <[email protected]> | 2024-02-22 15:28:32 -0600 | 
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-02-22 15:28:32 -0600 | 
| commit | f82ca7a951ef17e4ddb117d8715c7191c2f779b5 (patch) | |
| tree | 1cbadc66a0f69bd549921051b603408f433e876f | |
| parent | f8963c75638d16030a67aa1c79da55dbc824a79e (diff) | |
skip comments in config file
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | flags.go | 20 | ||||
| -rw-r--r-- | listWindow.go | 15 | 
3 files changed, 35 insertions, 2 deletions
@@ -1,6 +1,6 @@  all: -	@echo this is a go library, not a binary  	@GO111MODULE=off go build +	@echo this is a go library with buildable code  goimports:  	goimports -w *.go diff --git a/flags.go b/flags.go new file mode 100644 index 0000000..5ff1319 --- /dev/null +++ b/flags.go @@ -0,0 +1,20 @@ +package gowit + +/* +	this enables command line options from other packages like 'gui' and 'log' +*/ + +import ( +	"go.wit.com/log" +) + +var WIT *log.LogFlag +var WITWARN *log.LogFlag + +func init() { +	full := "go.wit.com/lib/gui/gowit" +	short := "gowit" + +	WIT = log.NewFlag("WIT", true, full, short, "general go.wit.com things") +	WITWARN = log.NewFlag("WITWARN", true, full, short, "wit.com warnings") +} diff --git a/listWindow.go b/listWindow.go index c69b759..61239b3 100644 --- a/listWindow.go +++ b/listWindow.go @@ -94,6 +94,15 @@ func ListWindow(view *repolist.RepoList) *gadgets.BasicWindow {  	currents = NewSection(group, "local (~/.config/myrepolist)")  	for i, line := range myrepolist() { +		line = strings.TrimSpace(line) +		if line == "" { +			// skip blank lines +			continue +		} +		if strings.HasPrefix(line, "#") { +			// skip comment lines +			continue +		}  		parts := strings.Split(line, " ")  		log.Info("adding:", i, parts)  		currents.add(view, parts[0]) @@ -202,8 +211,12 @@ func (s *section) add(view *repolist.RepoList, path string) {  		log.Verbose("repo is already downloaded", path)  		tmp.downloadB.SetLabel("downloaded")  		tmp.downloadB.Disable() +		s.grid.NewButton("Configure", func() { +			log.Log(WIT, "todo: open the repo window here") +		})  	} +	s.grid.NextRow()  	s.witRepos = append(s.witRepos, tmp)  } @@ -228,7 +241,7 @@ func NewSection(parent *gui.Node, desc string) *section {  		}  		lw.Enable()  	}) -	news.grid = news.parent.NewGrid("sections", 2, 1) +	news.grid = news.parent.NewGrid("sections", 0, 0)  	allsections = append(allsections, news)  	return news  }  | 
