From 552fda014b6c584cd2b8ab0d90f44190adb21dd6 Mon Sep 17 00:00:00 2001 From: Jan De Dobbeleer Date: Sat, 12 Dec 2020 12:53:53 +0100 Subject: [PATCH] fix: styling fixes for execution time --- docs/docs/segment-executiontime.md | 7 ++++--- segment_executiontime.go | 16 +++++++++++----- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/docs/docs/segment-executiontime.md b/docs/docs/segment-executiontime.md index b6b9f325..09f11ac7 100644 --- a/docs/docs/segment-executiontime.md +++ b/docs/docs/segment-executiontime.md @@ -8,7 +8,9 @@ sidebar_label: Execution Time Displays the execution time of the previously executed command. -To use this, use the PowerShell module, or confirm that you are passing an `execution-time` argument contianing the elapsed milliseconds to the oh-my-posh executable. The [installation guide][install] shows how to include this argument for PowerShell and Zsh. +To use this, use the PowerShell module, or confirm that you are passing an `execution-time` argument containing the +elapsed milliseconds to the oh-my-posh executable. +The [installation guide][install] shows how to include this argument for PowerShell and Zsh. ## Sample Configuration @@ -46,5 +48,4 @@ Style specifies the format in which the time will be displayed. The table below | houston | `00:00:00.001` | `00:00:02.1` | `00:03:02.1` | `04:03:02.1` | | amarillo | `0.001s` | `2.1s` | `182.1s` | `14,582.1s` | - -[install]: /docs/installation \ No newline at end of file +[install]: /docs/installation diff --git a/segment_executiontime.go b/segment_executiontime.go index 724cd53c..8caba6d8 100644 --- a/segment_executiontime.go +++ b/segment_executiontime.go @@ -14,18 +14,24 @@ type executiontime struct { output string } +// DurationStyle how to display the time type DurationStyle string const ( // ThresholdProperty represents minimum duration (milliseconds) required to enable this segment ThresholdProperty Property = "threshold" - - Austin DurationStyle = "austin" + // Austin milliseconds short + Austin DurationStyle = "austin" + // Roundrock milliseconds long Roundrock DurationStyle = "roundrock" - Dallas DurationStyle = "dallas" + // Dallas milliseconds full + Dallas DurationStyle = "dallas" + // Galveston hour Galveston DurationStyle = "galveston" - Houston DurationStyle = "houston" - Amarillo DurationStyle = "amarillo" + // Houston hour and milliseconds + Houston DurationStyle = "houston" + // Amarillo seconds + Amarillo DurationStyle = "amarillo" second = 1000 minute = 60000