mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 19:47:45 +00:00
Merge pull request #8094 from cakebaker/uname_fix_order_of_output
uname: output OS last
This commit is contained in:
commit
938fd7860f
1 changed files with 6 additions and 9 deletions
|
@ -38,24 +38,21 @@ pub struct UNameOutput {
|
||||||
|
|
||||||
impl UNameOutput {
|
impl UNameOutput {
|
||||||
fn display(&self) -> String {
|
fn display(&self) -> String {
|
||||||
let mut output = String::new();
|
[
|
||||||
for name in [
|
|
||||||
self.kernel_name.as_ref(),
|
self.kernel_name.as_ref(),
|
||||||
self.nodename.as_ref(),
|
self.nodename.as_ref(),
|
||||||
self.kernel_release.as_ref(),
|
self.kernel_release.as_ref(),
|
||||||
self.kernel_version.as_ref(),
|
self.kernel_version.as_ref(),
|
||||||
self.machine.as_ref(),
|
self.machine.as_ref(),
|
||||||
self.os.as_ref(),
|
|
||||||
self.processor.as_ref(),
|
self.processor.as_ref(),
|
||||||
self.hardware_platform.as_ref(),
|
self.hardware_platform.as_ref(),
|
||||||
|
self.os.as_ref(),
|
||||||
]
|
]
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.flatten()
|
.flatten()
|
||||||
{
|
.map(|name| name.as_str())
|
||||||
output.push_str(name);
|
.collect::<Vec<_>>()
|
||||||
output.push(' ');
|
.join(" ")
|
||||||
}
|
|
||||||
output
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new(opts: &Options) -> UResult<Self> {
|
pub fn new(opts: &Options) -> UResult<Self> {
|
||||||
|
@ -138,7 +135,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||||
os: matches.get_flag(options::OS),
|
os: matches.get_flag(options::OS),
|
||||||
};
|
};
|
||||||
let output = UNameOutput::new(&options)?;
|
let output = UNameOutput::new(&options)?;
|
||||||
println!("{}", output.display().trim_end());
|
println!("{}", output.display());
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue