| 1 |
// Copyright 2025 The Jujutsu Authors |
| 2 |
// |
| 3 |
// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 |
// you may not use this file except in compliance with the License. |
| 5 |
// You may obtain a copy of the License at |
| 6 |
// |
| 7 |
// https://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
// |
| 9 |
// Unless required by applicable law or agreed to in writing, software |
| 10 |
// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 |
// See the License for the specific language governing permissions and |
| 13 |
// limitations under the License. |
| 14 |
|
| 15 |
use std::io::Write as _; |
| 16 |
|
| 17 |
fn main() { |
| 18 |
let mut args_os = std::env::args_os().skip(1).peekable(); |
| 19 |
while let Some(arg_os) = args_os.next() { |
| 20 |
std::io::stdout() |
| 21 |
.write_all(arg_os.as_encoded_bytes()) |
| 22 |
.unwrap_or_else(|e| { |
| 23 |
panic!( |
| 24 |
"Failed to write the argument \"{}\" to stdout: {e}", |
| 25 |
arg_os.display() |
| 26 |
) |
| 27 |
}); |
| 28 |
if args_os.peek().is_some() { |
| 29 |
write!(std::io::stdout(), " ").unwrap_or_else(|e| { |
| 30 |
panic!("Failed to write the space separator to stdout: {e}"); |
| 31 |
}); |
| 32 |
} |
| 33 |
} |
| 34 |
writeln!(std::io::stdout()) |
| 35 |
.unwrap_or_else(|e| panic!("Failed to write the terminating newline to stdout: {e}")); |
| 36 |
} |