diff options
author | nicolargo <nicolas@nicolargo.com> | 2017-12-28 11:32:12 +0100 |
---|---|---|
committer | nicolargo <nicolas@nicolargo.com> | 2017-12-28 11:32:12 +0100 |
commit | 13e4652bf11f8c1e13dfb397608c3eca1c3f4fc4 (patch) | |
tree | 79d639f3d37c9cd446d20bfa82d1d82e42baa1de /glances/standalone.py | |
parent | 62efccb8523483b03be530a08cf6fa891c9a9d13 (diff) |
Add support for the --modules-list
Diffstat (limited to 'glances/standalone.py')
-rw-r--r-- | glances/standalone.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/glances/standalone.py b/glances/standalone.py index 52121157..354e8217 100644 --- a/glances/standalone.py +++ b/glances/standalone.py @@ -19,6 +19,7 @@ """Manage the Glances standalone session.""" +import sys from glances.globals import WINDOWS from glances.logger import logger @@ -41,6 +42,12 @@ class GlancesStandalone(object): # Init stats self.stats = GlancesStats(config=config, args=args) + # Modules (plugins and exporters) are loaded at this point + # Glances can display the list if asked... + if args.modules_list: + self.display_modules_list() + sys.exit(0) + # If process extended stats is disabled by user if not args.enable_process_extended: logger.debug("Extended stats for top process are disabled") @@ -85,6 +92,13 @@ class GlancesStandalone(object): def quiet(self): return self._quiet + def display_modules_list(self): + """Display modules list""" + print("Plugins list: {}".format( + ', '.join(sorted(self.stats.getPluginsList(enable=False))))) + print("Exporters list: {}".format( + ', '.join(sorted(self.stats.getExportsList(enable=False))))) + def __serve_forever(self): """Main loop for the CLI.""" # Start a counter used to compute the time needed for |