Skip to content

Commit

Permalink
Few fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Matija Pevec committed Jan 14, 2020
1 parent b4fe199 commit 64326ca
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions client/client.go
Expand Up @@ -128,3 +128,12 @@ type Entity struct {
type EntityId struct {
Id int64 `json:"id"`
}

func (e EntityId) String() string {
switch e.Id {
case 0:
return "-"
default:
return fmt.Sprintf("%v", e.Id)
}
}
2 changes: 1 addition & 1 deletion cmd/search.go
Expand Up @@ -25,7 +25,7 @@ func init() {
rootCmd.AddCommand(searchCmd)

searchCmd.Flags().IntVarP(&searchOffset, "offset", "o", 0, "Offset from first result")
searchCmd.Flags().IntVarP(&searchLimit, "limit", "l", 25, "Limit of given search results")
searchCmd.Flags().IntVarP(&searchLimit, "limit", "l", 5, "Limit of given search results")
}

func searchFunc(_ *cobra.Command, args []string) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/timeentries.go
Expand Up @@ -100,7 +100,7 @@ func timeEntriesListFunc(cmd *cobra.Command, _ []string) {
t.AppendHeader(table.Row{"ID", "Project", "Issue ID",
"Activity", "Hours", "Spent on", "Comment"})
for _, log := range logs {
t.AppendRow(table.Row{log.Id, log.Project.Name, log.Issue.Id,
t.AppendRow(table.Row{log.Id, log.Project.Name, log.Issue.String(),
log.Activity.Name, log.Hours, RelativeDateString(log.SpentOn),
log.Comments})
}
Expand Down

0 comments on commit 64326ca

Please sign in to comment.