diff --git a/main.go b/main.go index 1d46793..08ed973 100644 --- a/main.go +++ b/main.go @@ -39,7 +39,7 @@ func main() { config: ".jimmy.json", } - // NOTE: Flags need match each option key's first letter. + // NOTE: Flags need to match each option key's first letter. flag.StringVar(&opt.Name, "n", "Jimbo", "Project title") flag.StringVar(&opt.Source, "s", "", "Source repository") flag.Var(&opt.Branches, "b", "Target branches") @@ -168,7 +168,7 @@ func main() { log.Printf("user cache set: %s", tmp) - pro := NewProject(dir, opt.Name, tmp, opt) + pro := NewProject(dir, tmp, opt) // Create base directories. if err := pro.init(); err != nil { diff --git a/project.go b/project.go index 048fe58..89db5e5 100644 --- a/project.go +++ b/project.go @@ -26,21 +26,21 @@ type project struct { branches []branch } -func NewProject(base string, name string, repo string, options *options) *project { +func NewProject(base string, repo string, options *options) *project { funcMap := template.FuncMap{ "diffstatbodyparser": diffstatbodyparser, "diffbodyparser": diffbodyparser, } template := template.Must(template.New("page").Funcs(funcMap).Parse(tpl)) - branches, err := branchFilter(repo, name, options) + branches, err := branchFilter(repo, options) if err != nil { log.Fatalf("unable to filter branches: %v", err) } return &project{ base: base, - Name: name, + Name: options.Name, repo: repo, options: options, template: template,
home › develop › 4126508 › 74a42c1