main: Add a --list-modes command line option

Add a command line option to list available modes, i.e. possible
arguments for the --mode switch.

https://bugzilla.gnome.org/show_bug.cgi?id=676156
This commit is contained in:
Florian Müllner
2012-05-18 03:52:57 +02:00
parent e49b94658c
commit ecff2fa2b7
3 changed files with 71 additions and 6 deletions

View File

@ -80,6 +80,12 @@ function modeExists(mode) {
return modes.indexOf(mode) != -1;
}
function listModes() {
let modes = Object.getOwnPropertyNames(_modes);
for (let i = 0; i < modes.length; i++)
print(modes[i]);
}
const SessionMode = new Lang.Class({
Name: 'SessionMode',