@@ -63,11 +63,13 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
6363 let matches = uu_app ( ) . try_get_matches_from ( args) ?;
6464
6565 #[ cfg( windows) ]
66- let _handle = wsa:: start ( ) . map_err_context ( || "failed to start Winsock" . to_owned ( ) ) ?;
66+ let _handle = wsa:: start ( ) . map_err_context ( || get_message ( "hostname-error-winsock" ) ) ?;
6767
6868 match matches. get_one :: < OsString > ( OPT_HOST ) {
6969 None => display_hostname ( & matches) ,
70- Some ( host) => hostname:: set ( host) . map_err_context ( || "failed to set hostname" . to_owned ( ) ) ,
70+ Some ( host) => {
71+ hostname:: set ( host) . map_err_context ( || get_message ( "hostname-error-set-hostname" ) )
72+ }
7173 }
7274}
7375
@@ -82,31 +84,31 @@ pub fn uu_app() -> Command {
8284 . short ( 'd' )
8385 . long ( "domain" )
8486 . overrides_with_all ( [ OPT_DOMAIN , OPT_IP_ADDRESS , OPT_FQDN , OPT_SHORT ] )
85- . help ( "Display the name of the DNS domain if possible" )
87+ . help ( get_message ( "hostname-help- domain" ) )
8688 . action ( ArgAction :: SetTrue ) ,
8789 )
8890 . arg (
8991 Arg :: new ( OPT_IP_ADDRESS )
9092 . short ( 'i' )
9193 . long ( "ip-address" )
9294 . overrides_with_all ( [ OPT_DOMAIN , OPT_IP_ADDRESS , OPT_FQDN , OPT_SHORT ] )
93- . help ( "Display the network address(es) of the host" )
95+ . help ( get_message ( "hostname-help-ip- address" ) )
9496 . action ( ArgAction :: SetTrue ) ,
9597 )
9698 . arg (
9799 Arg :: new ( OPT_FQDN )
98100 . short ( 'f' )
99101 . long ( "fqdn" )
100102 . overrides_with_all ( [ OPT_DOMAIN , OPT_IP_ADDRESS , OPT_FQDN , OPT_SHORT ] )
101- . help ( "Display the FQDN (Fully Qualified Domain Name) (default)" )
103+ . help ( get_message ( "hostname-help-fqdn" ) )
102104 . action ( ArgAction :: SetTrue ) ,
103105 )
104106 . arg (
105107 Arg :: new ( OPT_SHORT )
106108 . short ( 's' )
107109 . long ( "short" )
108110 . overrides_with_all ( [ OPT_DOMAIN , OPT_IP_ADDRESS , OPT_FQDN , OPT_SHORT ] )
109- . help ( "Display the short hostname (the portion before the first dot) if possible" )
111+ . help ( get_message ( " hostname-help-short" ) )
110112 . action ( ArgAction :: SetTrue ) ,
111113 )
112114 . arg (
0 commit comments