mirror of
				https://github.com/f-droid/fdroidserver.git
				synced 2025-11-04 06:30:27 +03:00 
			
		
		
		
	purge .txt and .json from bash-completion
YAML is the way!
This commit is contained in:
		
							parent
							
								
									b63e9e68c5
								
							
						
					
					
						commit
						1b90aec697
					
				
					 1 changed files with 4 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -26,16 +26,15 @@ __fdroid_init() {
 | 
			
		|||
	(( $# >= 1 )) && __complete_${1}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
__by_ext() {
 | 
			
		||||
	local ext="$1"
 | 
			
		||||
	files=( metadata/*.$ext )
 | 
			
		||||
__get_appid() {
 | 
			
		||||
	files=( metadata/*.yml )
 | 
			
		||||
	files=( ${files[@]#metadata/} )
 | 
			
		||||
	files=${files[@]%.$ext}
 | 
			
		||||
	files=${files[@]%.yml}
 | 
			
		||||
	echo "$files"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
__package() {
 | 
			
		||||
	files="$(__by_ext txt) $(__by_ext yml) $(__by_ext json)"
 | 
			
		||||
	files="$(__get_appid)"
 | 
			
		||||
	COMPREPLY=( $( compgen -W "$files" -- $cur ) )
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue