perbu / powercost

MIT License
6 stars 1 forks source link

Add flag for short time format #3

Closed oven closed 2 years ago

oven commented 2 years ago

Adds a new flag to pwrcost to display hours in short time format

$ ./pwrcost -h
Usage of ./pwrcost:
  -short-time
        Use short time format on axis labels
  -tomorrow
        Show price for tomorrow instead of today
  -zone string
        Which price zone to show (default "NO1")

This produces the following output:

$ ./pwrcost -short-time
 0.63 ┤                                                 ╭─────╮
 0.59 ┤                                                ╭╯     ╰╮
 0.54 ┤                                              ╭─╯       ╰╮
 0.50 ┤                        ╭────────╮          ╭─╯          ╰╮ ╭─────────╮
 0.45 ┤                     ╭──╯        ╰──────────╯             ╰─╯         ╰
 0.41 ┤                    ╭╯
 0.36 ┤                   ╭╯
 0.32 ┼─╮                ╭╯
 0.27 ┤ ╰─╮            ╭─╯
 0.23 ┤   ╰─╮       ╭──╯
 0.18 ┤     ╰───────╯
                             Prices for 2022-11-09 in NO1
     00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
perbu commented 2 years ago

I think this should replace the current way time is displayed. The minutes don't really add much value.

perbu commented 2 years ago

I'll fix it.