-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support multiple config paths and add
/etc/ssh/ssh_config
as …
…a default one Signed-off-by: Nathanael DEMACON <quantumsheep@users.noreply.github.com>
- Loading branch information
1 parent
b067719
commit 9eb5291
Showing
6 changed files
with
143 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#[derive(Debug)] | ||
pub struct UnknownEntryError { | ||
pub line: String, | ||
pub entry: String, | ||
} | ||
|
||
#[derive(Debug)] | ||
pub enum InvalidIncludeErrorDetails { | ||
Pattern(glob::PatternError), | ||
Glob(glob::GlobError), | ||
Io(std::io::Error), | ||
HostsInsideHostBlock, | ||
} | ||
|
||
#[derive(Debug)] | ||
pub struct InvalidIncludeError { | ||
pub line: String, | ||
pub details: InvalidIncludeErrorDetails, | ||
} | ||
|
||
#[derive(Debug)] | ||
pub enum ParseError { | ||
Io(std::io::Error), | ||
UnparseableLine(String), | ||
UnknownEntry(UnknownEntryError), | ||
InvalidInclude(InvalidIncludeError), | ||
} | ||
|
||
impl From<std::io::Error> for ParseError { | ||
fn from(e: std::io::Error) -> Self { | ||
ParseError::Io(e) | ||
} | ||
} | ||
|
||
impl From<UnknownEntryError> for ParseError { | ||
fn from(e: UnknownEntryError) -> Self { | ||
ParseError::UnknownEntry(e) | ||
} | ||
} | ||
|
||
impl From<InvalidIncludeError> for ParseError { | ||
fn from(e: InvalidIncludeError) -> Self { | ||
ParseError::InvalidInclude(e) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters