command_complete: improvements

take into account tokens that consume no input args instead of
skipping them.

Signed-off-by: Guillermo Ontanon <guillermo@midokura.jp>