Add --mi option to the list command

The --mi option is used to ask lttng to print information in a format
easily understandable by another program. Currently, only session
printing is affected: it prints session names one per line.

The term mi stands for machine interface, and is stolen without any
remorse from GDB's lexicon.

Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Reorder functions _lttng_cmd_* functions in bash completion

Simply reorder them alphabetically to be consistent.

Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Add --list-commands option to the snapshot command

It lists snapshot sub-commands. This involves moving list_commands
to utils so that commands can use it.

Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Update bash completion

- Refactor options completion to remove a little bit of code
  duplication.
- Add subcommand completion for the snapshot command. It is not perfect,
  but it's a start.
- Add some comments to functions here and there.

Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Add session name completion in bash completion

Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Signed-off-by: David Goulet <dgoulet@efficios.com>