Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 264714
Collapse All | Expand All

(-)file_not_specified_in_diff (-7 / +30 lines)
Line  Link Here
0
-- bash-completion/bash_completion
0
++ bash-completion-new/bash_completion
Lines 404-409 Link Here
404
	COMPREPLY=( $( compgen -W '$( command ps axo pgid | sed 1d )' -- $cur ))
404
	COMPREPLY=( $( compgen -W '$( command ps axo pgid | sed 1d )' -- $cur ))
405
}
405
}
406
406
407
# This function completes on process names.
408
# AIX and SunOS prefer X/Open, all else should be BSD.
409
[ $UNAME = SunOS -o $UNAME = AIX ] &&
410
_pnames()
411
{
412
	COMPREPLY=( $( compgen -W '$( command ps -efo comm | \
413
			           sed -e 1d -e "s:.*/::" -e "s/^-//" \
414
				       -e "s/^<defunct>$//")' \
415
			           -- $cur ) )
416
} ||
417
_pnames()
418
{
419
	# FIXME: completes "[kblockd/0]" to "0". Previously it was completed
420
	# to "kblockd" which isn't correct either. "kblockd/0" would be
421
	# arguably most correct, but killall from psmisc 22 treats arguments
422
	# containing "/" specially unless -r is given so that wouldn't quite
423
	# work either. Perhaps it'd be best to not complete these to anything
424
	# for now.
425
	# Not using "ps axo comm" because under some Linux kernels, it
426
	# truncates command names (see e.g. http://bugs.debian.org/497540#19)
427
	COMPREPLY=( $( compgen -W '$( command ps axo command | \
428
			           sed -e "1d; s/ .*//; s:.*/::; s/:$//;" \
429
			               -e "s/^[[(-]//; s/[])]$//" \
430
				       -e "s/^<defunct>$//")' \
431
			           -- $cur ) )
432
}
433
407
# This function completes on user IDs
434
# This function completes on user IDs
408
#
435
#
409
_uids()
436
_uids()
Lines 972-980 Link Here
972
	if [ $COMP_CWORD -eq 1 ] && [[ "$cur" == -* ]]; then
999
	if [ $COMP_CWORD -eq 1 ] && [[ "$cur" == -* ]]; then
973
		_signals
1000
		_signals
974
	else
1001
	else
975
		COMPREPLY=( $( compgen -W '$( command ps axo comm | \
1002
		_pnames
976
			      sed -ne "1d; s/^\[\?\([^-][^] ]*\).*$/\1/p" | \
977
			      sed -e "s/.*\///" )' -- $cur ) )
978
	fi
1003
	fi
979
1004
980
	return 0
1005
	return 0
Lines 991-999 Link Here
991
	COMPREPLY=()
1016
	COMPREPLY=()
992
	cur=`_get_cword`
1017
	cur=`_get_cword`
993
1018
994
	COMPREPLY=( $( compgen -W '$( command ps axo command | \
1019
	_pnames
995
		      sed -ne "1d; s/^\[\?\([^-][^] ]*\).*$/\1/p" | \
996
		      sed -e "s/.*\///" )' -- $cur ) )
997
1020
998
	return 0
1021
	return 0
999
}
1022
}

Return to bug 264714