File: echo.rs

package info (click to toggle)
rust-coreutils 0.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 505,620 kB
  • sloc: ansic: 103,594; asm: 28,570; sh: 8,910; python: 5,581; makefile: 472; cpp: 97; javascript: 72
file content (19 lines) | stat: -rw-r--r-- 575 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use os_display::Quotable;

fn main() {
    for arg in std::env::args_os().skip(1) {
        println!("Native: {}", arg.maybe_quote());
        #[cfg(all(windows, feature = "unix"))]
        {
            if let Some(arg) = arg.to_str() {
                println!("Unix: {}", os_display::Quoted::unix(arg).force(false));
            }
        }
        #[cfg(all(not(windows), feature = "windows"))]
        {
            if let Some(arg) = arg.to_str() {
                println!("Windows: {}", os_display::Quoted::windows(arg).force(false));
            }
        }
    }
}