mirror of
				https://github.com/f-droid/fdroidserver.git
				synced 2025-11-04 06:30:27 +03:00 
			
		
		
		
	bash-completion: add appid support for all formats
This commit is contained in:
		
							parent
							
								
									ac37e3084e
								
							
						
					
					
						commit
						23747edb25
					
				
					 1 changed files with 9 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -37,10 +37,16 @@ __fdroid_init() {
 | 
			
		|||
	(( $# >= 1 )) && __complete_${1}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
__package() {
 | 
			
		||||
	files=( metadata/*.txt )
 | 
			
		||||
__by_ext() {
 | 
			
		||||
	local ext="$1"
 | 
			
		||||
	files=( metadata/*.$ext )
 | 
			
		||||
	files=( ${files[@]#metadata/} )
 | 
			
		||||
	files=${files[@]%.txt}
 | 
			
		||||
	files=${files[@]%.$ext}
 | 
			
		||||
	echo "$files"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
__package() {
 | 
			
		||||
	files="$(__by_ext txt) $(__by_ext yaml) $(__by_ext json) $(__by_ext xml)"
 | 
			
		||||
	COMPREPLY=( $( compgen -W "$files" -- $cur ) )
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue