text instead of empty list
This commit is contained in:
parent
c8ebf6df33
commit
428b828c45
|
@ -88,5 +88,5 @@ func (del Delete) Do(deps Dependencies) (CommandResult, error) {
|
||||||
type DeleteResult struct{}
|
type DeleteResult struct{}
|
||||||
|
|
||||||
func (dr DeleteResult) Render() string {
|
func (dr DeleteResult) Render() string {
|
||||||
return "task deleted"
|
return "task removed"
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,6 +137,10 @@ type ListResult struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (lr ListResult) Render() string {
|
func (lr ListResult) Render() string {
|
||||||
|
if len(lr.Tasks) == 0 {
|
||||||
|
return "\nno tasks to display\n"
|
||||||
|
}
|
||||||
|
|
||||||
sort.Slice(lr.Tasks, func(i, j int) bool {
|
sort.Slice(lr.Tasks, func(i, j int) bool {
|
||||||
if lr.Tasks[i].Task.Date.After(lr.Tasks[j].Task.Date) {
|
if lr.Tasks[i].Task.Date.After(lr.Tasks[j].Task.Date) {
|
||||||
return false
|
return false
|
||||||
|
|
Loading…
Reference in New Issue