* cli/cli-decode.c (complete_on_cmdlist): Make two passes over the command list. gdb/testsuite * gdb.base/completion.exp: Add tests for completion and deprecated commands.