feat: Add ability for command duration in milliseconds (#380)

This commit is contained in:
Tom Hotston
2019-09-24 20:03:10 +01:00
committed by Kevin Song
parent c9878cab69
commit c5e971aef8
6 changed files with 51 additions and 35 deletions
+7 -7
View File
@@ -212,7 +212,7 @@ use_symbol_for_status = true
## Command Duration
The `cmd_duration` module shows how long the last command took to execute.
The module will be shown only if the command took longer than two seconds, or
The module will be shown only if the command took longer than 2000 milliseconds (2 seconds), or
the `min_time` config value, if it exists.
::: warning Do not hook the DEBUG trap in Bash
@@ -227,11 +227,11 @@ running `eval $(starship init $0)`, and then proceed as normal.
### Options
| Variable | Default | Description |
| ---------- | --------------- | ----------------------------------- |
| `min_time` | `2` | Shortest duration to show time for. |
| `style` | `"bold yellow"` | The style for the module. |
| `disabled` | `false` | Disables the `cmd_duration` module. |
| Variable | Default | Description |
| ---------- | --------------- | ----------------------------------------------------- |
| `min_time` | `2000` | Shortest duration to show time for (in milliseconds). |
| `style` | `"bold yellow"` | The style for the module. |
| `disabled` | `false` | Disables the `cmd_duration` module. |
### Example
@@ -239,7 +239,7 @@ running `eval $(starship init $0)`, and then proceed as normal.
# ~/.config/starship.toml
[cmd_duration]
min_time = 4
min_time = 4000
```
## Directory