bash completion: Don't hard-code "guix" binary name.
* etc/completion/bash/guix (_guix_complete_command):
Use ${COMP_WORDS[0]} instead of hard-coding "guix".
			
			
This commit is contained in:
		
							parent
							
								
									8f45555781
								
							
						
					
					
						commit
						0987a0eba4
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
					@ -28,10 +28,11 @@ _guix_complete_command ()
 | 
				
			||||||
    if [ -z "$_guix_commands" ]
 | 
					    if [ -z "$_guix_commands" ]
 | 
				
			||||||
    then
 | 
					    then
 | 
				
			||||||
	# Cache the list of commands to speed things up.
 | 
						# Cache the list of commands to speed things up.
 | 
				
			||||||
	_guix_commands="$(guix --help 2> /dev/null  \
 | 
						_guix_commands="$(${COMP_WORDS[0]} --help 2> /dev/null  \
 | 
				
			||||||
                                     | grep '^    ' \
 | 
					                                     | grep '^    ' \
 | 
				
			||||||
				     | sed '-es/^ *\([a-z-]\+\).*$/\1/g')"
 | 
									     | sed '-es/^ *\([a-z-]\+\).*$/\1/g')"
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    COMPREPLY+=($(compgen -W "$_guix_commands" -- "$word_at_point"))
 | 
					    COMPREPLY+=($(compgen -W "$_guix_commands" -- "$word_at_point"))
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue