Re: [PATCH 2/2] completion: Use parse-options raw output for simple long options

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Stephen Boyd wrote:

> Is there some way to compute these lists with some magical function instead
> of duplicating that logic over and over?

Maybe roughly like this.

	for command in $porcelain
	do
		eval "__git_${command//-/_}_options="
	done
	__git_complete_for_command ()
	{
		local options
		local options_var="__git_${command//-/_}_options"

		eval "options=\$$options_var"
		if test -z "$options"
		then
			eval "$options_var=\$(__git_list_command_options \$command)"
			eval "options=\$$options_var"
		fi

		...
	}

	_git () {
		...
		__git_complete_for_command "$command"
	}

Jonathan
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]