debian/rust-vendor/os_display/examples/echo.rs
raw| 1 | use os_display::Quotable; |
| 2 | |
| 3 | fn main() { |
| 4 | for arg in std::env::args_os().skip(1) { |
| 5 | println!("Native: {}", arg.maybe_quote()); |
| 6 | #[cfg(all(windows, feature = "unix"))] |
| 7 | { |
| 8 | if let Some(arg) = arg.to_str() { |
| 9 | println!("Unix: {}", os_display::Quoted::unix(arg).force(false)); |
| 10 | } |
| 11 | } |
| 12 | #[cfg(all(not(windows), feature = "windows"))] |
| 13 | { |
| 14 | if let Some(arg) = arg.to_str() { |
| 15 | println!("Windows: {}", os_display::Quoted::windows(arg).force(false)); |
| 16 | } |
| 17 | } |
| 18 | } |
| 19 | } |