@@ -59,8 +59,9 @@ impl UNameOutput {
5959 }
6060
6161 pub fn new ( opts : & Options ) -> UResult < Self > {
62- let uname =
63- PlatformInfo :: new ( ) . map_err ( |_e| USimpleError :: new ( 1 , "cannot get system name" ) ) ?;
62+ let uname = PlatformInfo :: new ( ) . map_err ( |_e| {
63+ USimpleError :: new ( 1 , get_message ( "uname-error-cannot-get-system-name" ) )
64+ } ) ?;
6465 let none = !( opts. all
6566 || opts. kernel_name
6667 || opts. nodename
@@ -90,11 +91,11 @@ impl UNameOutput {
9091
9192 // This option is unsupported on modern Linux systems
9293 // See: https://lists.gnu.org/archive/html/bug-coreutils/2005-09/msg00063.html
93- let processor = opts. processor . then ( || " unknown". to_string ( ) ) ;
94+ let processor = opts. processor . then ( || get_message ( "uname- unknown") ) ;
9495
9596 // This option is unsupported on modern Linux systems
9697 // See: https://lists.gnu.org/archive/html/bug-coreutils/2005-09/msg00063.html
97- let hardware_platform = opts. hardware_platform . then ( || " unknown". to_string ( ) ) ;
98+ let hardware_platform = opts. hardware_platform . then ( || get_message ( "uname- unknown") ) ;
9899
99100 Ok ( Self {
100101 kernel_name,
@@ -151,69 +152,66 @@ pub fn uu_app() -> Command {
151152 Arg :: new ( options:: ALL )
152153 . short ( 'a' )
153154 . long ( options:: ALL )
154- . help ( "Behave as though all of the options -mnrsvo were specified." )
155+ . help ( get_message ( "uname-help-all" ) )
155156 . action ( ArgAction :: SetTrue ) ,
156157 )
157158 . arg (
158159 Arg :: new ( options:: KERNEL_NAME )
159160 . short ( 's' )
160161 . long ( options:: KERNEL_NAME )
161162 . alias ( "sysname" ) // Obsolescent option in GNU uname
162- . help ( "print the kernel name." )
163+ . help ( get_message ( "uname-help- kernel- name" ) )
163164 . action ( ArgAction :: SetTrue ) ,
164165 )
165166 . arg (
166167 Arg :: new ( options:: NODENAME )
167168 . short ( 'n' )
168169 . long ( options:: NODENAME )
169- . help (
170- "print the nodename (the nodename may be a name that the system \
171- is known by to a communications network).",
172- )
170+ . help ( get_message ( "uname-help-nodename" ) )
173171 . action ( ArgAction :: SetTrue ) ,
174172 )
175173 . arg (
176174 Arg :: new ( options:: KERNEL_RELEASE )
177175 . short ( 'r' )
178176 . long ( options:: KERNEL_RELEASE )
179177 . alias ( "release" ) // Obsolescent option in GNU uname
180- . help ( "print the operating system release." )
178+ . help ( get_message ( "uname-help-kernel- release" ) )
181179 . action ( ArgAction :: SetTrue ) ,
182180 )
183181 . arg (
184182 Arg :: new ( options:: KERNEL_VERSION )
185183 . short ( 'v' )
186184 . long ( options:: KERNEL_VERSION )
187- . help ( "print the operating system version." )
185+ . help ( get_message ( "uname-help-kernel- version" ) )
188186 . action ( ArgAction :: SetTrue ) ,
189187 )
190188 . arg (
191189 Arg :: new ( options:: MACHINE )
192190 . short ( 'm' )
193191 . long ( options:: MACHINE )
194- . help ( "print the machine hardware name." )
192+ . help ( get_message ( "uname-help- machine" ) )
195193 . action ( ArgAction :: SetTrue ) ,
196194 )
197195 . arg (
198196 Arg :: new ( options:: OS )
199197 . short ( 'o' )
200198 . long ( options:: OS )
201- . help ( "print the operating system name." )
199+ . help ( get_message ( "uname-help-os" ) )
202200 . action ( ArgAction :: SetTrue ) ,
203201 )
204202 . arg (
205203 Arg :: new ( options:: PROCESSOR )
206204 . short ( 'p' )
207205 . long ( options:: PROCESSOR )
208- . help ( "print the processor type (non-portable)" )
206+ . help ( get_message ( "uname-help-processor" ) )
209207 . action ( ArgAction :: SetTrue )
210208 . hide ( true ) ,
211209 )
212210 . arg (
213211 Arg :: new ( options:: HARDWARE_PLATFORM )
214212 . short ( 'i' )
215213 . long ( options:: HARDWARE_PLATFORM )
216- . help ( "print the hardware platform (non-portable)" )
214+ . help ( get_message ( "uname-help- hardware-platform" ) )
217215 . action ( ArgAction :: SetTrue )
218216 . hide ( true ) ,
219217 )
0 commit comments