Bug 24085 - functions "usage" messages redesign
functions "usage" messages redesign
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
7.1
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-01-15 21:41 EST by Christian Rose
Modified: 2014-03-16 22:18 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-01-29 22:15:07 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Christian Rose 2001-01-15 21:41:03 EST
This is a part of the split-up of bug 24072.

#: ../rc.d/init.d/functions:270
msgid "Usage: status {program}\n"

The "status" program here should not be translated, since it is a script
name. So this message could be reduced to:

"Usage: %s {program}"

The benefit with this would be message re-use in the initscripts pot.


#: ../rc.d/init.d/functions:172
msgid "Usage: killproc {program} [signal]\n"

This could be reduced to
"Usage: %s {program} [signal]\n"
Comment 1 Christian Rose 2001-01-15 22:01:35 EST
More messages from initscripts package. All these messages have parameters that
do not need/shouldn't need to be translated:

#: ../rc.d/init.d/rawdevices:77
msgid "Usage: rawdevice {start|stop|status|restart}\n"

#: ../rc.d/init.d/random:56
msgid "Usage: %s {start|stop|status|restart|reload}\n"

#: ../rc.d/init.d/netfs:108
msgid "Usage: %s {start|stop|restart|reload|status}\n"

#: ../rc.d/init.d/network:200
msgid "Usage: %s {start|stop|restart|reload|status|probe}\n"

All these messages could be written and marked for translation as "Usage: %s %s"
since neither the script name nor the parameters need translation.
Comment 2 Bill Nottingham 2001-01-29 15:34:30 EST
This is not practical with the current (new) i18n setup.
Comment 3 Christian Rose 2001-01-29 17:06:17 EST
I fail to see why?
Comment 4 Bill Nottingham 2001-01-29 17:13:13 EST
It no longer uses printf, so the *only* available substitutions
are environment variables.
Comment 5 Christian Rose 2001-01-29 20:25:29 EST
But $0 is an environment variable, isn't it? Some of the other init scripts use
that now, and using it everywhere would be better message reuse.
Replace %s with $0 everywhere in my initial description and everything is still
valid.
Comment 6 Christian Rose 2001-01-29 20:32:26 EST
FYI:
#: /usr/local/initfoo/etc/rc.d/init.d/ipchains:114
msgid "Usage: $0 {start|stop|restart|status|panic|save}\n"

#: /usr/local/initfoo/etc/rc.d/init.d/mysqld:91
msgid "Usage: $0 {start|stop|status|reload|condrestart|restart}"

#: ../sysconfig/network-scripts/ifdown-aliases:7
#: ../sysconfig/network-scripts/ifup-ipx:7
msgid "usage: $0 <net-device>"

#: /usr/local/initfoo/etc/rc.d/init.d/canna:57
#: /usr/local/initfoo/etc/rc.d/init.d/gpm:82
msgid "Usage: $0 {start|stop|restart|condrestart|status}"

#: /usr/local/initfoo/etc/rc.d/init.d/squid:139
msgid "Usage: $0 {start|stop|status|reload|restart|condrestart}"

#: /usr/local/initfoo/etc/rc.d/init.d/kadmin:74
msgid "Usage: $0 {start|stop|status|condrestart|restart}"

#: /usr/local/initfoo/etc/rc.d/init.d/linuxconf:29
msgid "Usage: $0 {start|stop}"

#: /usr/local/initfoo/etc/rc.d/init.d/ldap:111
msgid "Usage: $0 {start|stop|restart|status|condrestart}"

#: /usr/local/initfoo/etc/rc.d/init.d/kprop:63
#: /usr/local/initfoo/etc/rc.d/init.d/krb524:64
#: /usr/local/initfoo/etc/rc.d/init.d/krb5kdc:64
#: /usr/local/initfoo/etc/rc.d/init.d/ypserv:66
msgid "Usage: $0 {start|stop|status|restart|condrestart}"

#: /usr/local/initfoo/etc/rc.d/init.d/rusersd:66
msgid "Usage: $0 {start|stop|status|restart}"

#: ../rc.d/init.d/functions:80 /usr/local/initfoo/etc/rc.d/init.d/functions:80
msgid "$0: Usage: daemon [+/-nicelevel] {program}"

Etc...
Comment 7 Bill Nottingham 2001-01-29 22:15:04 EST
Some of it, yes. But they can't be reduced to the catchall
'Usage: %s %s' anymore.

Ideally, usage for standard scripts would be implemened *in*
init.d/functions, but that's a post-this-release feature.
Comment 8 Bill Nottingham 2001-01-30 13:02:19 EST
Also, it's not valid for shell functions at all; $0 in them
returns 'bash', which is not what you want.

Everything appropriate in the initscripts package
(netfs, network, rawdevices) will use $0 as of 5.60-1.
Comment 9 Christian Rose 2001-01-30 13:44:04 EST
Ok. Thanks.

Note You need to log in before you can comment on or make changes to this bug.