diff --git a/Cargo.toml b/Cargo.toml index d50cd84a..fe1b0833 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,10 +26,6 @@ unicode-width = "~0.1.3" unicode-segmentation = "~0.1.2" term_size = { version = "~0.1.0", optional = true } -[target.'cfg(windows)'.dependencies] -kernel32-sys = "~0.2.2" -winapi = "~0.2.8" - [dev-dependencies] regex = "~0.1.69" diff --git a/src/app/help.rs b/src/app/help.rs index 90d6c52f..0c71bd42 100644 --- a/src/app/help.rs +++ b/src/app/help.rs @@ -14,41 +14,8 @@ use app::{App, AppSettings}; use app::parser::Parser; use fmt::{Format, Colorizer}; -#[cfg(all(feature = "wrap_help", not(target_os = "windows")))] +#[cfg(feature = "wrap_help")] use term_size; -#[cfg(all(feature = "wrap_help", target_os = "windows"))] -mod term_size { - use kernel32::{GetConsoleScreenBufferInfo, GetStdHandle}; - use winapi::{CONSOLE_SCREEN_BUFFER_INFO, COORD, SMALL_RECT, STD_OUTPUT_HANDLE}; - - pub fn dimensions() -> Option<(usize, usize)> { - let null_coord = COORD{ - X: 0, - Y: 0, - }; - let null_smallrect = SMALL_RECT{ - Left: 0, - Top: 0, - Right: 0, - Bottom: 0, - }; - - let stdout_h = unsafe { GetStdHandle(STD_OUTPUT_HANDLE) }; - let mut console_data = CONSOLE_SCREEN_BUFFER_INFO{ - dwSize: null_coord, - dwCursorPosition: null_coord, - wAttributes: 0, - srWindow: null_smallrect, - dwMaximumWindowSize: null_coord, - }; - - if unsafe { GetConsoleScreenBufferInfo(stdout_h, &mut console_data) } != 0 { - Some(((console_data.srWindow.Right - console_data.srWindow.Left) as usize, (console_data.srWindow.Bottom - console_data.srWindow.Top) as usize)) - } else { - None - } - } -} #[cfg(not(feature = "wrap_help"))] mod term_size { pub fn dimensions() -> Option<(usize, usize)> { diff --git a/src/lib.rs b/src/lib.rs index 4f1f38aa..5b243794 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -416,10 +416,6 @@ extern crate vec_map; #[cfg(feature = "wrap_help")] extern crate term_size; extern crate unicode_segmentation; -#[cfg(target_os = "windows")] -extern crate kernel32; -#[cfg(target_os = "windows")] -extern crate winapi; #[cfg(feature = "yaml")] pub use yaml_rust::YamlLoader;