mirror of
				https://github.com/ansible-collections/community.general.git
				synced 2025-10-24 21:14:00 -07:00 
			
		
		
		
	Include aliases in ansible-doc output (#27702)
* Properly include aliases in ansible-doc output Use correct variable name for storing aliases and only print them out if the list isn't empty. Fixes #24498 * Only include choices in output if choices exist in the list
This commit is contained in:
		
					parent
					
						
							
								97240a9ebc
							
						
					
				
			
			
				commit
				
					
						af558698a0
					
				
			
		
					 1 changed files with 4 additions and 2 deletions
				
			
		|  | @ -312,10 +312,12 @@ class DocCLI(CLI): | ||||||
| 
 | 
 | ||||||
|             aliases = '' |             aliases = '' | ||||||
|             if 'aliases' in opt: |             if 'aliases' in opt: | ||||||
|                 choices = "(Aliases: " + ", ".join(str(i) for i in opt['aliases']) + ")" |                 if len(opt['aliases']) > 0: | ||||||
|  |                     aliases = "(Aliases: " + ", ".join(str(i) for i in opt['aliases']) + ")" | ||||||
|                 del opt['aliases'] |                 del opt['aliases'] | ||||||
|             choices = '' |             choices = '' | ||||||
|             if 'choices' in opt: |             if 'choices' in opt: | ||||||
|  |                 if len(opt['choices']) > 0: | ||||||
|                     choices = "(Choices: " + ", ".join(str(i) for i in opt['choices']) + ")" |                     choices = "(Choices: " + ", ".join(str(i) for i in opt['choices']) + ")" | ||||||
|                 del opt['choices'] |                 del opt['choices'] | ||||||
|             default = '' |             default = '' | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue