zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: remove superfluous function definitions
@ 2021-07-08 23:27 Oliver Kiddle
  0 siblings, 0 replies; only message in thread
From: Oliver Kiddle @ 2021-07-08 23:27 UTC (permalink / raw)
  To: Zsh workers

Some completion functions use the ksh autoloading style of including the
function definition. And then also a final call to the function. This is
pointless and inefficient. It is fine where multiple functions are
defined but with just the one, it achieves nothing.

The patch below only removes those superfluous lines. Unless someone
objects, I'll also reindent the files before committing. But I don't
think it's useful to include that with the patch for everyone to see.

Oliver

diff --git a/Completion/Debian/Command/_dscverify b/Completion/Debian/Command/_dscverify
index 4d383c6c4..2624bd3d2 100644
--- a/Completion/Debian/Command/_dscverify
+++ b/Completion/Debian/Command/_dscverify
@@ -4,7 +4,6 @@
 # This is dscverify, from the Debian devscripts package, version 2.20.2
 # ...
 
-_dscverify() {
   local all_opts=(
     '--help[show the help message and exit]'
     '--version[show the version + copyright and exit]'
@@ -25,6 +24,3 @@ _dscverify() {
 
   _arguments \
     "$all_opts[@]"
-}
-
-_dscverify "$@"
diff --git a/Completion/Solaris/Command/_dhcpinfo b/Completion/Solaris/Command/_dhcpinfo
index 079b6e6f6..f5727234d 100644
--- a/Completion/Solaris/Command/_dhcpinfo
+++ b/Completion/Solaris/Command/_dhcpinfo
@@ -1,6 +1,5 @@
 #compdef dhcpinfo
 
-_dhcpinfo() {
 	local -a mnemonics_v4 mnemonics_v6
 
 	mnemonics_v4=(
@@ -30,7 +29,4 @@ _dhcpinfo() {
 		'-c[]' \
 		'-i[interface]:interface:' \
 		'-n[maximum number of lines]:limit:' \
-		':DHCP Parameter:_values "DHCP Parameter" $mnemonics_v4' \
-}
-
-_dhcpinfo "$@"
+		':DHCP parameter:_values "DHCP parameter" $mnemonics_v4' \
diff --git a/Completion/Solaris/Command/_inetadm b/Completion/Solaris/Command/_inetadm
index 0c8b14a4e..0facd68e1 100644
--- a/Completion/Solaris/Command/_inetadm
+++ b/Completion/Solaris/Command/_inetadm
@@ -1,6 +1,5 @@
 #compdef inetadm
 
-_inetadm() {
 	_arguments -s \
 		'-?[help]' \
 		'-l[list service instance properties]:FMRI:_svcs_fmri -i' \
@@ -9,8 +8,3 @@ _inetadm() {
 		'-p[list inet service properties]' \
 		'-m[modify service instance properties]:FMRI:_svcs_fmri -i' \
 		'-M[modify inet service properties]'
-}
-
-_inetadm "$@"
-
-# vi:tw=0
diff --git a/Completion/Solaris/Command/_prstat b/Completion/Solaris/Command/_prstat
index 1eb38845c..95783ae9f 100644
--- a/Completion/Solaris/Command/_prstat
+++ b/Completion/Solaris/Command/_prstat
@@ -1,7 +1,5 @@
 #compdef prstat
 
-_prstat()
-{
 	local d_opt sort_key
 	d_opt=(
 		"u"\:"seconds past the epoch"
@@ -41,6 +39,3 @@ _prstat()
 		'-v[verbose process usage]' \
 		'-z[only processes or LWPs whose zone ID is in the list]:zone ID:' \
 		'-Z[information about processes and zones]'
-}
-
-_prstat "$@"
diff --git a/Completion/Solaris/Command/_svcadm b/Completion/Solaris/Command/_svcadm
index c9826f2eb..a63811377 100644
--- a/Completion/Solaris/Command/_svcadm
+++ b/Completion/Solaris/Command/_svcadm
@@ -1,6 +1,5 @@
 #compdef svcadm
 
-_svcadm() {
 	local curcontext="$curcontext" state line expl subcmds
 	typeset -A opt_args
 
@@ -73,6 +72,3 @@ _svcadm() {
 	(*)
 		_message "unknown svcadm subcommand: $service"
 	esac
-}
-
-_svcadm "$@"
diff --git a/Completion/Solaris/Command/_svcprop b/Completion/Solaris/Command/_svcprop
index 4a5436caf..a2564342b 100644
--- a/Completion/Solaris/Command/_svcprop
+++ b/Completion/Solaris/Command/_svcprop
@@ -1,6 +1,5 @@
 #compdef svcprop
 
-_svcprop() {
 	_arguments -s \
 		'-f[designate properties by their FMRI]' \
 		'-q[quiet]' \
@@ -19,8 +18,3 @@ _svcprop() {
 		'(-c -C)-s[retrieve properties from snapshot]:snapshot:' \
 		'*-p[prints values of named property or property group]' \
 		'*:FMRI:_svcs_fmri -i'
-}
-
-_svcprop "$@"
-
-# vi:tw=0
diff --git a/Completion/Solaris/Command/_zlogin b/Completion/Solaris/Command/_zlogin
index 74cbafe82..eebe03278 100644
--- a/Completion/Solaris/Command/_zlogin
+++ b/Completion/Solaris/Command/_zlogin
@@ -1,7 +1,6 @@
 #compdef zlogin
 # Synced with the Nevada build 162 man page
 
-_zlogin() {
         local -a _comp_priv_prefix
 	_arguments -s \
 		'-E[Disable escape character]' \
@@ -15,6 +14,3 @@ _zlogin() {
 		'-S["Safe" login mode]' \
 		'(-):command name: _command_names -e' \
 		'*::utility: _normal'
-}
-
-_zlogin "$@"
diff --git a/Completion/Unix/Command/_pkginfo b/Completion/Unix/Command/_pkginfo
index 6c71082ef..eb514672c 100644
--- a/Completion/Unix/Command/_pkginfo
+++ b/Completion/Unix/Command/_pkginfo
@@ -1,6 +1,5 @@
 #compdef pkginfo
 
-_pkginfo() {
 	_arguments -s \
 	'(-q -r -x)-l[long listing]' \
 	'(-l -r -x)-q[quiet mode]' \
@@ -17,6 +16,3 @@ _pkginfo() {
 	- set2 \
 	'-d[device]:device file:_files' \
 	'*:package instance:_pkg_instance --_opts uninstalled:set2--d'
-}
-
-_pkginfo "$@"
diff --git a/Completion/Unix/Command/_pkgrm b/Completion/Unix/Command/_pkgrm
index 25a950221..0b8aeee9d 100644
--- a/Completion/Unix/Command/_pkgrm
+++ b/Completion/Unix/Command/_pkgrm
@@ -1,6 +1,5 @@
 #compdef pkgrm
 
-_pkgrm() {
 	_arguments -s \
 	'-Y[select packages by category]:category: ' \
 	- set1 \
@@ -15,6 +14,3 @@ _pkgrm() {
 	- set2 \
 	'-s[spool package]:spool directory:_files -/' \
 	'*:package instance:_pkg_instance --_opts spooled:set2--s'
-}
-
-_pkgrm "$@"


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-08 23:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-08 23:27 PATCH: remove superfluous function definitions Oliver Kiddle

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).