Bug 24085 - functions "usage" messages redesign
Summary: functions "usage" messages redesign
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: initscripts
Version: 7.1
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-01-16 02:41 UTC by Christian Rose
Modified: 2014-03-17 02:18 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2001-01-30 03:15:07 UTC
Embargoed:


Attachments (Terms of Use)

Description Christian Rose 2001-01-16 02:41:03 UTC
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-16 03:01:35 UTC
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 20:34:30 UTC
This is not practical with the current (new) i18n setup.

Comment 3 Christian Rose 2001-01-29 22:06:17 UTC
I fail to see why?

Comment 4 Bill Nottingham 2001-01-29 22:13:13 UTC
It no longer uses printf, so the *only* available substitutions
are environment variables.

Comment 5 Christian Rose 2001-01-30 01:25:29 UTC
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-30 01:32:26 UTC
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-30 03:15:04 UTC
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 18:02:19 UTC
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 18:44:04 UTC
Ok. Thanks.


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