Skip to main content

pretty_please/
error.rs

1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum PleaseError {
5    #[error(
6        "pls needs a command. Use `pls <command...>` or install a shell hook with `pls init <shell>`."
7    )]
8    MissingCommand,
9    #[error("there's no previous command to rerun yet.")]
10    EmptyHistory,
11    #[error("couldn't parse the previous command from shell history.")]
12    ParseHistory(#[source] shell_words::ParseError),
13    #[error("`{0}` is a shell builtin, so sudo can't change your current shell state.")]
14    Builtin(String),
15    #[error("`sudo` wasn't found on PATH. Install sudo first, or use `doas` directly for now.")]
16    MissingSudo,
17}