mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2025-04-20 10:53:06 +01:00
Merge 8d536f02e07afd0855d0ffb288caf1a050f4e92d into 232b45e6a66753cb9ef8cea6f6ea8dcc045434c1
This commit is contained in:
commit
a4314311a1
@ -100,7 +100,9 @@ Note that crates installed using `cargo install` require manual updating with `c
|
||||
Linutil supports configuration through a TOML config file. Path to the file can be specified with `--config` (or `-c`).
|
||||
|
||||
Available options:
|
||||
- `auto_execute` - a list of commands to execute automatically (can be combined with `--skip-confirmation`)
|
||||
- `auto_execute` - A list of commands to execute automatically (can be combined with `--skip-confirmation`)
|
||||
- `skip_confirmation` - Boolean ( Equal to `--skip-confirmation`)
|
||||
- `size_bypass` - Boolean ( Equal to `--size-bypass` )
|
||||
|
||||
Example config:
|
||||
```toml
|
||||
@ -111,6 +113,9 @@ auto_execute = [
|
||||
"Alacritty",
|
||||
"Kitty"
|
||||
]
|
||||
|
||||
skip_confirmation = true
|
||||
size_bypass = true
|
||||
```
|
||||
|
||||
```bash
|
||||
|
@ -168,18 +168,22 @@ impl AppState {
|
||||
}
|
||||
|
||||
fn spawn_confirmprompt(&mut self) {
|
||||
let cmd_names: Vec<_> = self
|
||||
.selected_commands
|
||||
.iter()
|
||||
.map(|node| node.name.as_str())
|
||||
.collect();
|
||||
if self.skip_confirmation {
|
||||
self.handle_confirm_command();
|
||||
} else {
|
||||
let cmd_names: Vec<_> = self
|
||||
.selected_commands
|
||||
.iter()
|
||||
.map(|node| node.name.as_str())
|
||||
.collect();
|
||||
|
||||
let prompt = ConfirmPrompt::new(&cmd_names);
|
||||
self.focus = Focus::ConfirmationPrompt(Float::new(
|
||||
Box::new(prompt),
|
||||
CONFIRM_PROMPT_FLOAT_SIZE,
|
||||
CONFIRM_PROMPT_FLOAT_SIZE,
|
||||
));
|
||||
let prompt = ConfirmPrompt::new(&cmd_names);
|
||||
self.focus = Focus::ConfirmationPrompt(Float::new(
|
||||
Box::new(prompt),
|
||||
CONFIRM_PROMPT_FLOAT_SIZE,
|
||||
CONFIRM_PROMPT_FLOAT_SIZE,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
fn get_list_item_shortcut(&self) -> Box<[Shortcut]> {
|
||||
@ -824,12 +828,7 @@ impl AppState {
|
||||
self.selected_commands.push(node);
|
||||
}
|
||||
}
|
||||
|
||||
if self.skip_confirmation {
|
||||
self.handle_confirm_command();
|
||||
} else {
|
||||
self.spawn_confirmprompt();
|
||||
}
|
||||
self.spawn_confirmprompt();
|
||||
}
|
||||
SelectedItem::None => {}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user