Skip to content

Commit

Permalink
fix: styling fixes for execution time
Browse files Browse the repository at this point in the history
  • Loading branch information
JanDeDobbeleer committed Dec 12, 2020
1 parent d5b41b3 commit 552fda0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
7 changes: 4 additions & 3 deletions docs/docs/segment-executiontime.md
Expand Up @@ -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

Expand Down Expand Up @@ -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
16 changes: 11 additions & 5 deletions segment_executiontime.go
Expand Up @@ -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
Expand Down

0 comments on commit 552fda0

Please sign in to comment.