1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

Use name/version when showing hostname's usage.

This commit is contained in:
Joseph Crail 2015-11-25 04:01:53 -05:00
parent 80f83ce15d
commit 55e5327573

View file

@ -27,6 +27,7 @@ use std::io::Write;
use std::net::ToSocketAddrs; use std::net::ToSocketAddrs;
static NAME: &'static str = "hostname"; static NAME: &'static str = "hostname";
static VERSION: &'static str = "1.0.0";
extern { extern {
fn gethostname(name: *mut libc::c_char, namelen: libc::size_t) -> libc::c_int; fn gethostname(name: *mut libc::c_char, namelen: libc::size_t) -> libc::c_int;
@ -119,7 +120,7 @@ pub fn uumain(args: Vec<String>) -> i32 {
} }
fn version() { fn version() {
println!("hostname 1.0.0"); println!("{} {}", NAME, VERSION);
} }
fn help_menu(program: &str, options: Options) { fn help_menu(program: &str, options: Options) {