Re: [RFC PATCH 1/1] completion: load completion file for external subcommand

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

 



On 2018-04-09 07:59, Junio C Hamano wrote:
>  	local completion_func="_git_${command//-/_}"
> +	if ! declare -f $completion_func >/dev/null 2>/dev/null; then
> +		declare -f __load_completion >/dev/null 2>/dev/null &&
> +			__load_completion "git-$command"

wouldn't the above be easier to read if it were

	if ! declare ... $completion_func ... && declare -f __load_completion
	then
		__load_completion "git-$command"
	fi

or is there a reason why it is better to &&-chain the check for
__load_completion with its use?  Same comment applies to the other
hunk.

Good point. I could go even further and ditch the if-construct:

   ! declare -f $completion_func && declare -f __load_completion &&
       __load_completion "git-$command"

I originally intended to do a if-else-construct, which I re-thought
halfway through. I will change that in the next iteration.

Thank you!

--
Regards

Florian



[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]

  Powered by Linux