Add command flag for inline_height (#905)

* add a command flag for `inline_height`

* docs

* docs: better formating for short command flags
This commit is contained in:
VuiMuich 2023-05-02 10:00:52 +02:00 committed by GitHub
parent 244a501cbb
commit 5a0e63370a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 22 deletions

View file

@ -96,6 +96,10 @@ pub struct Cmd {
/// Example: --format "{time} - [{duration}] - {directory}$\t{command}" /// Example: --format "{time} - [{duration}] - {directory}$\t{command}"
#[arg(long, short)] #[arg(long, short)]
format: Option<String>, format: Option<String>,
/// Set the maximum number of lines Atuin's interface should take up.
#[arg(long = "inline-height")]
inline_height: Option<u16>,
} }
impl Cmd { impl Cmd {
@ -118,6 +122,9 @@ impl Cmd {
if self.filter_mode.is_some() { if self.filter_mode.is_some() {
settings.filter_mode = self.filter_mode.unwrap(); settings.filter_mode = self.filter_mode.unwrap();
} }
if self.inline_height.is_some() {
settings.inline_height = self.inline_height.unwrap();
}
settings.shell_up_key_binding = self.shell_up_key_binding; settings.shell_up_key_binding = self.shell_up_key_binding;

View file

@ -5,13 +5,13 @@ title: Listing History
# `atuin history list` # `atuin history list`
| Arg | Description | | Arg | Description |
| -------------- | ----------------------------------------------------------------------------- | | ---------------- | ----------------------------------------------------------------------------- |
| `--cwd/-c` | The directory to list history for (default: all dirs) | | `--cwd`/`-c` | The directory to list history for (default: all dirs) |
| `--session/-s` | Enable listing history for the current session only (default: false) | | `--session`/`-s` | Enable listing history for the current session only (default: false) |
| `--human` | Use human-readable formatting for the timestamp and duration (default: false) | | `--human` | Use human-readable formatting for the timestamp and duration (default: false) |
| `--cmd-only` | Show only the text of the command (default: false) | | `--cmd-only` | Show only the text of the command (default: false) |
| `--format` | Specify the formatting of a command (see below) | | `--format` | Specify the formatting of a command (see below) |
## Format ## Format

View file

@ -9,21 +9,24 @@ Atuin search supports wildcards, with either the `*` or `%` character. By
default, a prefix search is performed (ie, all queries are automatically default, a prefix search is performed (ie, all queries are automatically
appended with a wildcard). appended with a wildcard).
| Arg | Description | | Arg | Description |
| ------------------ | ----------------------------------------------------------------------------- | | -------------------- | ----------------------------------------------------------------------------- |
| `--cwd/-c` | The directory to list history for (default: all dirs) | | `--cwd`/`-c` | The directory to list history for (default: all dirs) |
| `--exclude-cwd` | Do not include commands that ran in this directory (default: none) | | `--exclude-cwd` | Do not include commands that ran in this directory (default: none) |
| `--exit/-e` | Filter by exit code (default: none) | | `--exit`/`-e` | Filter by exit code (default: none) |
| `--exclude-exit` | Do not include commands that exited with this value (default: none) | | `--exclude-exit` | Do not include commands that exited with this value (default: none) |
| `--before` | Only include commands ran before this time(default: none) | | `--before` | Only include commands ran before this time(default: none) |
| `--after` | Only include commands ran after this time(default: none) | | `--after` | Only include commands ran after this time(default: none) |
| `--interactive/-i` | Open the interactive search UI (default: false) | | `--interactive`/`-i` | Open the interactive search UI (default: false) |
| `--human` | Use human-readable formatting for the timestamp and duration (default: false) | | `--human` | Use human-readable formatting for the timestamp and duration (default: false) |
| `--limit` | Limit the number of results (default: none) | | `--limit` | Limit the number of results (default: none) |
| `--offset` | Offset from the start of the results (default: none) | | `--offset` | Offset from the start of the results (default: none) |
| `--delete` | Delete history matching this query | | `--delete` | Delete history matching this query |
| `--delete-it-all` | Delete all shell history | | `--delete-it-all` | Delete all shell history |
| `--reverse` | Reverse order of search results, oldest first | | `--reverse` | Reverse order of search results, oldest first |
| `--format`/`-f` | Available vareables: {command}, {directory}, {duration}, {user}, {host}, {time}, {exit} and {relativetime}. Example: --format "{time} - [{duration}] - {directory}$\t{command}" |
| `--inline-height` | Set the maximum number of lines Atuin's interface should take up |
| `--help`/`-h` | Print help |
## `atuin search -i` ## `atuin search -i`