mirror of
https://github.com/veeso/termscp.git
synced 2026-06-08 14:18:41 +02:00
docs: document core host and ssh modules
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
//! ## Remote CLI Arguments
|
||||||
|
//!
|
||||||
|
//! Parses positional and bookmark-based CLI arguments into the normalized remote
|
||||||
|
//! connection parameters used by the application.
|
||||||
|
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
use super::Args;
|
use super::Args;
|
||||||
@@ -13,8 +18,11 @@ enum AddrType {
|
|||||||
/// Args for remote connection
|
/// Args for remote connection
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct RemoteArgs {
|
pub struct RemoteArgs {
|
||||||
|
/// Optional host bridge selected for the session.
|
||||||
pub host_bridge: Remote,
|
pub host_bridge: Remote,
|
||||||
|
/// Target remote selected for the session.
|
||||||
pub remote: Remote,
|
pub remote: Remote,
|
||||||
|
/// Optional local working directory override.
|
||||||
pub local_dir: Option<PathBuf>,
|
pub local_dir: Option<PathBuf>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,6 +117,7 @@ pub enum Remote {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Remote {
|
impl Remote {
|
||||||
|
/// Returns whether this CLI slot was left unspecified.
|
||||||
pub fn is_none(&self) -> bool {
|
pub fn is_none(&self) -> bool {
|
||||||
matches!(self, Self::None)
|
matches!(self, Self::None)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
//! ## Host Bridge
|
||||||
|
//!
|
||||||
|
//! Defines the host abstraction used to expose localhost and bridged remote
|
||||||
|
//! filesystems through a shared interface.
|
||||||
|
|
||||||
use std::io::{Read, Write};
|
use std::io::{Read, Write};
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
//! ## Localhost Host Bridge
|
||||||
|
//!
|
||||||
|
//! Implements the host bridge abstraction directly against the local
|
||||||
|
//! filesystem.
|
||||||
|
|
||||||
use std::fs::{self, OpenOptions};
|
use std::fs::{self, OpenOptions};
|
||||||
use std::io::{Read, Write};
|
use std::io::{Read, Write};
|
||||||
#[cfg(posix)]
|
#[cfg(posix)]
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
//! ## Remote Bridged Host
|
||||||
|
//!
|
||||||
|
//! Bridges a `RemoteFs` implementation behind the local host interface used by
|
||||||
|
//! the file transfer activity.
|
||||||
|
|
||||||
mod temp_mapped_file;
|
mod temp_mapped_file;
|
||||||
|
|
||||||
use std::io::{Read, Write};
|
use std::io::{Read, Write};
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
//! ## Import SSH Hosts
|
||||||
|
//!
|
||||||
|
//! Imports OpenSSH host entries into termscp bookmarks and optionally registers
|
||||||
|
//! referenced private keys in the configured SSH key storage.
|
||||||
|
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::io::BufReader;
|
use std::io::BufReader;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
|
//! ## SSH Utilities
|
||||||
|
//!
|
||||||
|
//! Provides small helpers for loading SSH configuration files used by bookmarks
|
||||||
|
//! and setup flows.
|
||||||
|
|
||||||
use ssh2_config::{ParseRule, SshConfig};
|
use ssh2_config::{ParseRule, SshConfig};
|
||||||
|
|
||||||
|
/// Parses an OpenSSH-style config file into an `ssh2_config::SshConfig`.
|
||||||
pub fn parse_ssh2_config(path: &str) -> Result<SshConfig, String> {
|
pub fn parse_ssh2_config(path: &str) -> Result<SshConfig, String> {
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::io::BufReader;
|
use std::io::BufReader;
|
||||||
|
|||||||
Reference in New Issue
Block a user