| 
									
										
										
										
											2024-04-17 15:11:06 +01:00
										 |  |  | # | 
					
						
							|  |  |  | # Copyright 2010 Red Hat, Inc. | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | # This library is free software; you can redistribute it and/or modify | 
					
						
							|  |  |  | # it under the terms of the GNU Lesser General Public License as | 
					
						
							|  |  |  | # published by the Free Software Foundation; either version 2.1 of the | 
					
						
							|  |  |  | # licence, or (at your option) any later version. | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | # This is distributed in the hope that it will be useful, but WITHOUT | 
					
						
							|  |  |  | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | 
					
						
							|  |  |  | # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public | 
					
						
							|  |  |  | # License for more details. | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | # You should have received a copy of the GNU Lesser General Public License | 
					
						
							|  |  |  | # along with this library; if not, see <http://www.gnu.org/licenses/>. | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | # SPDX-License-Identifier: LGPL-2.1-or-later | 
					
						
							| 
									
										
										
										
											2010-05-06 14:13:59 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-16 13:51:44 +01:00
										 |  |  | # shellcheck shell=bash | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-05-06 14:13:59 -04:00
										 |  |  | # Check for bash | 
					
						
							|  |  |  | [ -z "$BASH_VERSION" ] && return | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #################################################################################################### | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | __gdbus() { | 
					
						
							| 
									
										
										
										
											2024-04-17 15:08:43 +01:00
										 |  |  |     local gdbus_binary | 
					
						
							|  |  |  |     gdbus_binary="$1" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-05-06 14:13:59 -04:00
										 |  |  |     local IFS=$'\n' | 
					
						
							| 
									
										
										
										
											2024-04-16 14:05:04 +01:00
										 |  |  |     local cur | 
					
						
							|  |  |  |     cur="$(_get_cword :)" | 
					
						
							| 
									
										
										
										
											2010-05-06 14:13:59 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-16 14:05:04 +01:00
										 |  |  |     local suggestions | 
					
						
							| 
									
										
										
										
											2024-04-17 15:08:43 +01:00
										 |  |  |     suggestions="$("$gdbus_binary" complete "${COMP_LINE}" "${COMP_POINT}")" | 
					
						
							| 
									
										
										
										
											2024-04-16 14:09:36 +01:00
										 |  |  |     # shellcheck disable=SC2207 | 
					
						
							| 
									
										
										
										
											2010-05-06 14:13:59 -04:00
										 |  |  |     COMPREPLY=($(compgen -W "$suggestions" -- "$cur")) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     # Remove colon-word prefix from COMPREPLY items | 
					
						
							|  |  |  |     case "$cur" in | 
					
						
							|  |  |  |         *:*) | 
					
						
							|  |  |  |             case "$COMP_WORDBREAKS" in | 
					
						
							|  |  |  |                 *:*) | 
					
						
							| 
									
										
										
										
											2024-04-16 14:06:13 +01:00
										 |  |  |                     local colon_word=${cur%"${cur##*:}"} | 
					
						
							| 
									
										
										
										
											2010-05-06 14:13:59 -04:00
										 |  |  |                     local i=${#COMPREPLY[*]} | 
					
						
							|  |  |  |                     while [ $((--i)) -ge 0 ]; do | 
					
						
							| 
									
										
										
										
											2024-04-16 14:03:19 +01:00
										 |  |  |                         COMPREPLY[i]=${COMPREPLY[i]#"$colon_word"} | 
					
						
							| 
									
										
										
										
											2010-05-06 14:13:59 -04:00
										 |  |  |                     done | 
					
						
							|  |  |  |                     ;; | 
					
						
							|  |  |  |             esac | 
					
						
							|  |  |  |             ;; | 
					
						
							|  |  |  |     esac | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #################################################################################################### | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | complete -o nospace -F __gdbus gdbus |