improved bash completion script

* fixed a bug with listprojects command name
* only long option names are expanded
* now various options depends on the given command, and are not
  expanded by default (start with -* and tab to list them)
* project names are only expanded when a suitable command is given
  before, and they are not expanded more than one time