mirror of
				https://github.com/moby/moby.git
				synced 2022-11-09 12:21:53 -05:00 
			
		
		
		
	Using names in docker ps --since-id/--before-id, resolves #3565
Also renames --since-id/--before-id to --since/--before and add errors on non-existent containers. Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
This commit is contained in:
		
							parent
							
								
									bfbf338f51
								
							
						
					
					
						commit
						c1f2abd899
					
				
					 5 changed files with 29 additions and 15 deletions
				
			
		| 
						 | 
				
			
			@ -392,11 +392,8 @@ _docker_port()
 | 
			
		|||
_docker_ps()
 | 
			
		||||
{
 | 
			
		||||
	case "$prev" in
 | 
			
		||||
		--since-id|--before-id)
 | 
			
		||||
			COMPREPLY=( $( compgen -W "$( __docker_q ps -a -q )" -- "$cur" ) )
 | 
			
		||||
			# TODO replace this with __docker_containers_all
 | 
			
		||||
			# see https://github.com/dotcloud/docker/issues/3565
 | 
			
		||||
			return
 | 
			
		||||
		--since|--before)
 | 
			
		||||
 			__docker_containers_all
 | 
			
		||||
			;;
 | 
			
		||||
		-n)
 | 
			
		||||
			return
 | 
			
		||||
| 
						 | 
				
			
			@ -407,7 +404,7 @@ _docker_ps()
 | 
			
		|||
 | 
			
		||||
	case "$cur" in
 | 
			
		||||
		-*)
 | 
			
		||||
			COMPREPLY=( $( compgen -W "-q --quiet -s --size -a --all --no-trunc -l --latest --since-id --before-id -n" -- "$cur" ) )
 | 
			
		||||
			COMPREPLY=( $( compgen -W "-q --quiet -s --size -a --all --no-trunc -l --latest --since --before -n" -- "$cur" ) )
 | 
			
		||||
			;;
 | 
			
		||||
		*)
 | 
			
		||||
			;;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -154,13 +154,13 @@ complete -c docker -A -f -n '__fish_seen_subcommand_from port' -a '(__fish_print
 | 
			
		|||
# ps
 | 
			
		||||
complete -c docker -f -n '__fish_docker_no_subcommand' -a ps -d 'List containers'
 | 
			
		||||
complete -c docker -A -f -n '__fish_seen_subcommand_from ps' -s a -l all -d 'Show all containers. Only running containers are shown by default.'
 | 
			
		||||
complete -c docker -A -f -n '__fish_seen_subcommand_from ps' -l before-id -d 'Show only container created before Id, include non-running ones.'
 | 
			
		||||
complete -c docker -A -f -n '__fish_seen_subcommand_from ps' -l before -d 'Show only container created before Id or Name, include non-running ones.'
 | 
			
		||||
complete -c docker -A -f -n '__fish_seen_subcommand_from ps' -s l -l latest -d 'Show only the latest created container, include non-running ones.'
 | 
			
		||||
complete -c docker -A -f -n '__fish_seen_subcommand_from ps' -s n -d 'Show n last created containers, include non-running ones.'
 | 
			
		||||
complete -c docker -A -f -n '__fish_seen_subcommand_from ps' -l no-trunc -d "Don't truncate output"
 | 
			
		||||
complete -c docker -A -f -n '__fish_seen_subcommand_from ps' -s q -l quiet -d 'Only display numeric IDs'
 | 
			
		||||
complete -c docker -A -f -n '__fish_seen_subcommand_from ps' -s s -l size -d 'Display sizes'
 | 
			
		||||
complete -c docker -A -f -n '__fish_seen_subcommand_from ps' -l since-id -d 'Show only containers created since Id, include non-running ones.'
 | 
			
		||||
complete -c docker -A -f -n '__fish_seen_subcommand_from ps' -l since -d 'Show only containers created since Id or Name, include non-running ones.'
 | 
			
		||||
 | 
			
		||||
# pull
 | 
			
		||||
complete -c docker -f -n '__fish_docker_no_subcommand' -a pull -d 'Pull an image or a repository from the docker registry server'
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue