fix: styling fixes for execution time

This commit is contained in:
Jan De Dobbeleer 2020-12-12 12:53:53 +01:00 committed by Jan De Dobbeleer
parent d5b41b37b2
commit 552fda014b
2 changed files with 15 additions and 8 deletions

View file

@ -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
[install]: /docs/installation

View file

@ -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