Skip to content

Commit 8efa2b8

Browse files
authored
Minor fixes for release (#253)
- Add `--no-style` option for `klog config` (to allow stdout>file redirection) - Improve help texts
1 parent 34acd3b commit 8efa2b8

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

klog/app/cli/config.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88

99
type Config struct {
1010
ConfigFilePath bool `name:"file-path" help:"Prints the path to your config file"`
11+
lib.NoStyleArgs
1112
}
1213

1314
func (opt *Config) Help() string {
@@ -19,18 +20,21 @@ You may use the output as template for setting up your config file, as its forma
1920
}
2021

2122
func (opt *Config) Run(ctx app.Context) app.Error {
23+
opt.NoStyleArgs.Apply(&ctx)
2224
if opt.ConfigFilePath {
2325
ctx.Print(app.Join(ctx.KlogConfigFolder(), app.CONFIG_FILE_NAME).Path() + "\n")
2426
return nil
2527
}
2628
for i, e := range app.CONFIG_FILE_ENTRIES {
27-
ctx.Print(lib.Subdued.Format(lib.Reflower.Reflow(e.Help.Summary, []string{"# "})))
29+
ctx.Print(ctx.Serialiser().Format(lib.Subdued, lib.Reflower.Reflow(e.Help.Summary, []string{"# "})))
2830
ctx.Print("\n")
29-
ctx.Print(lib.Subdued.Format(lib.Reflower.Reflow("Value: "+e.Help.Value, []string{"# - ", "# "})))
31+
ctx.Print(ctx.Serialiser().Format(lib.Subdued, lib.Reflower.Reflow("Value: "+e.Help.Value, []string{"# - ", "# "})))
3032
ctx.Print("\n")
31-
ctx.Print(lib.Subdued.Format(lib.Reflower.Reflow("Default: "+e.Help.Default, []string{"# - ", "# "})))
33+
ctx.Print(ctx.Serialiser().Format(lib.Subdued, lib.Reflower.Reflow("Default: "+e.Help.Default, []string{"# - ", "# "})))
3234
ctx.Print("\n")
33-
ctx.Print(lib.Red.Format(e.Name) + ` = ` + terminalformat.Style{Color: "227"}.Format(e.Value(ctx.Config())))
35+
ctx.Print(ctx.Serialiser().Format(lib.Red, e.Name))
36+
ctx.Print(" = ")
37+
ctx.Print(ctx.Serialiser().Format(terminalformat.Style{Color: "227"}, e.Value(ctx.Config())))
3438
if i < len(app.CONFIG_FILE_ENTRIES)-1 {
3539
ctx.Print("\n\n")
3640
}

klog/app/cli/lib/args.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ type FilterArgs struct {
153153
Today bool `name:"today" group:"Filter" help:"Records at today’s date"`
154154
Yesterday bool `name:"yesterday" group:"Filter" help:"Records at yesterday’s date"`
155155
Tomorrow bool `name:"tomorrow" group:"Filter" help:"Records at tomorrow’s date"`
156-
ThisXXX bool `name:"this-***" group:"Filter" help:"Records of this week/month/quarter/year"`
157-
LastXXX bool `name:"last-***" group:"Filter" help:"Records of last week/month/quarter/year"`
156+
ThisXXX bool `name:"this-***" group:"Filter" help:"Records of this week/month/quarter/year, e.g. --this-week"`
157+
LastXXX bool `name:"last-***" group:"Filter" help:"Records of last week/month/quarter/year, e.g. --last-month"`
158158
ThisWeek bool `hidden:"" name:"this-week" group:"Filter"`
159159
ThisWeekAlias bool `hidden:"" name:"thisweek" group:"Filter"`
160160
LastWeek bool `hidden:"" name:"last-week" group:"Filter"`

klog/app/cli/today.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ type Today struct {
2020
}
2121

2222
func (opt *Today) Help() string {
23-
return `Evaluates the total time, separately for today’s records and all other records.
23+
return `Convenience command to “check in” on the current day.
24+
It evaluates the total time separately for today’s records and all other records.
2425
2526
When both --now and --diff are set, it also calculates the forecasted end-time at which the time goal will be reached.
2627
(I.e. when the difference between should and actual time will be 0.)

0 commit comments

Comments
 (0)