diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-06-07 18:40:52 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-06-07 18:40:52 +0300 |
commit | 92d827a033c761488c414e3f7800d2d4c7ac7e44 (patch) | |
tree | ef15f9ec91ba49dd701437d3d8841577e80202d2 /src | |
parent | 60ea032dde202ef13eea9b258d298053797ea5c5 (diff) | |
download | paranucker-92d827a033c761488c414e3f7800d2d4c7ac7e44.tar.gz paranucker-92d827a033c761488c414e3f7800d2d4c7ac7e44.tar.bz2 paranucker-92d827a033c761488c414e3f7800d2d4c7ac7e44.tar.xz paranucker-92d827a033c761488c414e3f7800d2d4c7ac7e44.zip |
Add support for smalldump plugin command. It dump only node type and file name.
Diffstat (limited to 'src')
-rw-r--r-- | src/command.h | 3 | ||||
-rw-r--r-- | src/logger.cpp | 9 | ||||
-rw-r--r-- | src/plugin.cpp | 4 |
3 files changed, 15 insertions, 1 deletions
diff --git a/src/command.h b/src/command.h index c2f129c..e5cb62b 100644 --- a/src/command.h +++ b/src/command.h @@ -23,7 +23,8 @@ enum Command : int { Parse = 0, - Dump + Dump, + SmallDump }; extern Command command; diff --git a/src/logger.cpp b/src/logger.cpp index 9a3b936..5cd65b6 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -108,6 +108,15 @@ void log(const Node *const node, void log(const Node *const node) { + if (command == Command::SmallDump) + { + fprintf(stderr, + "%s %s\n", + node->nodeType.c_str(), + node->file.c_str()); + return; + } + if (command != Command::Dump) return; diff --git a/src/plugin.cpp b/src/plugin.cpp index 78f3ee1..0bc47ad 100644 --- a/src/plugin.cpp +++ b/src/plugin.cpp @@ -58,6 +58,10 @@ int plugin_init (struct plugin_name_args *plugin_info, { command = Command::Dump; } + else if (cmd == "smalldump") + { + command = Command::SmallDump; + } else { error("Plugin %s. Unknown command: %s", |