diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a5a1d8..21cc761 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed ### Removed +## [0.16.2] - 2022-05-27 +### Changed +- The following fields now default to false when missing in JSON request body + - For `DirRead`: `absolute`, `canonicalize`, `include_root` + - For `DirCreate`: `all` + - For `Remove`: `force` + - For `Watch`: `recursive` + - For `Metadata`: `canonicalize` and `resolve_file_type` + - For `ProcSpawn`: `args` (empty list), `persist`, and `pty` (nothing) + ## [0.16.1] - 2022-05-13 ### Changed - Lock in to Rust openssl 0.10.38 as it is the last version that supports using diff --git a/Cargo.lock b/Cargo.lock index 798e9a3..b9dcd63 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -539,7 +539,7 @@ dependencies = [ [[package]] name = "distant" -version = "0.16.1" +version = "0.16.2" dependencies = [ "assert_cmd", "assert_fs", @@ -567,7 +567,7 @@ dependencies = [ [[package]] name = "distant-core" -version = "0.16.1" +version = "0.16.2" dependencies = [ "assert_fs", "bitflags", @@ -596,7 +596,7 @@ dependencies = [ [[package]] name = "distant-ssh2" -version = "0.16.1" +version = "0.16.2" dependencies = [ "assert_cmd", "assert_fs", diff --git a/Cargo.toml b/Cargo.toml index 501fa89..b549ef7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "distant" description = "Operate on a remote computer through file and process manipulation" categories = ["command-line-utilities"] keywords = ["cli"] -version = "0.16.1" +version = "0.16.2" authors = ["Chip Senkbeil "] edition = "2018" homepage = "https://github.com/chipsenkbeil/distant" @@ -26,7 +26,7 @@ ssh2 = ["distant-ssh2/ssh2"] [dependencies] derive_more = { version = "0.99.16", default-features = false, features = ["display", "from", "error", "is_variant"] } -distant-core = { version = "=0.16.1", path = "distant-core", features = ["structopt"] } +distant-core = { version = "=0.16.2", path = "distant-core", features = ["structopt"] } flexi_logger = "0.18.0" indoc = "1.0.3" log = "0.4.14" @@ -43,7 +43,7 @@ termwiz = "0.15.0" whoami = "1.1.2" # Optional native SSH functionality -distant-ssh2 = { version = "=0.16.1", path = "distant-ssh2", default-features = false, features = ["serde"], optional = true } +distant-ssh2 = { version = "=0.16.2", path = "distant-ssh2", default-features = false, features = ["serde"], optional = true } [target.'cfg(unix)'.dependencies] fork = "0.1.18" diff --git a/distant-core/Cargo.toml b/distant-core/Cargo.toml index 3117592..44b66c5 100644 --- a/distant-core/Cargo.toml +++ b/distant-core/Cargo.toml @@ -3,7 +3,7 @@ name = "distant-core" description = "Core library for distant, enabling operation on a remote computer through file and process manipulation" categories = ["network-programming"] keywords = ["api", "async"] -version = "0.16.1" +version = "0.16.2" authors = ["Chip Senkbeil "] edition = "2018" homepage = "https://github.com/chipsenkbeil/distant" diff --git a/distant-core/src/data.rs b/distant-core/src/data.rs index 03f4739..e872397 100644 --- a/distant-core/src/data.rs +++ b/distant-core/src/data.rs @@ -131,6 +131,7 @@ pub enum RequestData { depth: usize, /// Whether or not to return absolute or relative paths + #[serde(default)] #[cfg_attr(feature = "structopt", structopt(short, long))] absolute: bool, @@ -140,6 +141,7 @@ pub enum RequestData { /// /// Note that the flag absolute must be true to have absolute paths /// returned, even if canonicalize is flagged as true + #[serde(default)] #[cfg_attr(feature = "structopt", structopt(short, long))] canonicalize: bool, @@ -148,6 +150,7 @@ pub enum RequestData { /// /// If included, the root directory will also be a canonicalized, /// absolute path and will not follow any of the other flags + #[serde(default)] #[cfg_attr(feature = "structopt", structopt(long))] include_root: bool, }, @@ -159,6 +162,7 @@ pub enum RequestData { path: PathBuf, /// Whether or not to create all parent directories + #[serde(default)] #[cfg_attr(feature = "structopt", structopt(short, long))] all: bool, }, @@ -171,6 +175,7 @@ pub enum RequestData { /// Whether or not to remove all contents within directory if is a directory. /// Does nothing different for files + #[serde(default)] #[cfg_attr(feature = "structopt", structopt(short, long))] force: bool, }, @@ -202,23 +207,24 @@ pub enum RequestData { /// If true, will recursively watch for changes within directories, othewise /// will only watch for changes immediately within directories + #[serde(default)] #[cfg_attr(feature = "structopt", structopt(short, long))] recursive: bool, /// Filter to only report back specified changes + #[serde(default)] #[cfg_attr( feature = "structopt", structopt(short, long, possible_values = &ChangeKind::VARIANTS) )] - #[serde(default)] only: Vec, /// Filter to report back changes except these specified changes + #[serde(default)] #[cfg_attr( feature = "structopt", structopt(short, long, possible_values = &ChangeKind::VARIANTS) )] - #[serde(default)] except: Vec, }, @@ -242,10 +248,12 @@ pub enum RequestData { /// Whether or not to include a canonicalized version of the path, meaning /// returning the canonical, absolute form of a path with all /// intermediate components normalized and symbolic links resolved + #[serde(default)] #[cfg_attr(feature = "structopt", structopt(short, long))] canonicalize: bool, /// Whether or not to follow symlinks to determine absolute file type (dir/file) + #[serde(default)] #[cfg_attr(feature = "structopt", structopt(long))] resolve_file_type: bool, }, @@ -257,14 +265,17 @@ pub enum RequestData { cmd: String, /// Arguments for the command + #[serde(default)] args: Vec, /// Whether or not the process should be persistent, meaning that the process will not be /// killed when the associated client disconnects + #[serde(default)] #[cfg_attr(feature = "structopt", structopt(long))] persist: bool, /// If provided, will spawn process in a pty, otherwise spawns directly + #[serde(default)] #[cfg_attr(feature = "structopt", structopt(long))] pty: Option, }, diff --git a/distant-ssh2/Cargo.toml b/distant-ssh2/Cargo.toml index 2afc1a2..453da0e 100644 --- a/distant-ssh2/Cargo.toml +++ b/distant-ssh2/Cargo.toml @@ -2,7 +2,7 @@ name = "distant-ssh2" description = "Library to enable native ssh-2 protocol for use with distant sessions" categories = ["network-programming"] -version = "0.16.1" +version = "0.16.2" authors = ["Chip Senkbeil "] edition = "2018" homepage = "https://github.com/chipsenkbeil/distant" @@ -17,7 +17,7 @@ ssh2 = ["wezterm-ssh/ssh2", "wezterm-ssh/vendored-openssl-ssh2"] [dependencies] async-compat = "0.2.1" -distant-core = { version = "=0.16.1", path = "../distant-core" } +distant-core = { version = "=0.16.2", path = "../distant-core" } futures = "0.3.16" log = "0.4.14" rand = { version = "0.8.4", features = ["getrandom"] }