less output for done and update

This commit is contained in:
Erik Winter 2021-09-04 19:47:36 +02:00
parent 529b24aa13
commit d264ed0040
11 changed files with 13 additions and 13 deletions

View File

@ -41,5 +41,5 @@ func (d *Done) Do() string {
return format.FormatError(err)
}
return "message sent\n"
return ""
}

View File

@ -7,5 +7,5 @@ func NewEmpty() (*Empty, error) {
}
func (cmd *Empty) Do() string {
return "did nothing\n"
return "did nothing\n\n"
}

View File

@ -34,5 +34,5 @@ func (s *Fetch) Do() string {
return format.FormatError(err)
}
return fmt.Sprintf("fetched %d tasks\n", result.Count)
return fmt.Sprintf("fetched %d tasks\n\n", result.Count)
}

View File

@ -51,7 +51,7 @@ func (f *Folder) Do() string {
}
if len(res.Tasks) == 0 {
return "no tasks here\n"
return "no tasks here\n\n"
}
return format.FormatTaskTable(res.Tasks)

View File

@ -28,5 +28,5 @@ func (i *Inbox) Do() string {
return format.FormatError(err)
}
return fmt.Sprintf("processed %d tasks\n", res.Count)
return fmt.Sprintf("processed %d tasks\n\n", res.Count)
}

View File

@ -38,7 +38,7 @@ func (p *Project) Do() string {
}
if len(res.Tasks) == 0 {
return "no tasks here\n"
return "no tasks here\n\n"
}
return format.FormatTaskTable(res.Tasks)

View File

@ -35,7 +35,7 @@ func (p *Projects) Do() string {
}
if len(projects) == 0 {
return "no projects here\n"
return "no projects here\n\n"
}
var out string
@ -45,5 +45,5 @@ func (p *Projects) Do() string {
}
}
return out
return fmt.Sprintf("%s\n", out)
}

View File

@ -39,5 +39,5 @@ func (r *Recur) Do() string {
return format.FormatError(err)
}
return fmt.Sprintf("generated %d tasks\n", res.Count)
return fmt.Sprintf("generated %d tasks\n\n", res.Count)
}

View File

@ -32,5 +32,5 @@ func (s *Send) Do() string {
return format.FormatError(err)
}
return fmt.Sprintf("sent %d tasks\n", count)
return fmt.Sprintf("sent %d tasks\n\n", count)
}

View File

@ -33,7 +33,7 @@ func FormatTaskTable(tasks []*task.LocalTask) string {
output += fmt.Sprintf("%d%s\t%s\t%s (%s)\n", t.LocalId, updateStr, t.Due.String(), t.Action, t.Project)
}
return output
return fmt.Sprintf("%s\n", output)
}
func FormatTask(t *task.LocalTask) string {
@ -46,7 +46,7 @@ due: %s
output += fmt.Sprintf("recur:%s", t.Recur.String())
}
return output
return fmt.Sprintf("%s\n", output)
}
func ParseTaskFieldArgs(args []string) (*task.LocalUpdate, error) {

View File

@ -25,5 +25,5 @@ func main() {
fmt.Println(err, "could not initialize command")
os.Exit(1)
}
fmt.Printf("%s\n", cmd.Do())
fmt.Printf("%s", cmd.Do())
}