summaryrefslogtreecommitdiffstats
path: root/test/list-undocumented-commands.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/list-undocumented-commands.py')
-rwxr-xr-xtest/list-undocumented-commands.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/list-undocumented-commands.py b/test/list-undocumented-commands.py
new file mode 100755
index 0000000..4729b48
--- /dev/null
+++ b/test/list-undocumented-commands.py
@@ -0,0 +1,29 @@
+#!/usr/bin/python3
+#
+# Script to discover and report undocumented commands.
+
+from crmsh.ui_root import Root
+from crmsh import help
+
+help.HELP_FILE = "doc/crm.8.adoc"
+help._load_help()
+
+_IGNORED_COMMANDS = ('help', 'quit', 'cd', 'up', 'ls')
+
+
+def check_help(ui):
+ for name, child in ui.children().items():
+ if child.type == 'command':
+ try:
+ h = help.help_command(ui.name, name)
+ if h.generated and name not in _IGNORED_COMMANDS:
+ print("Undocumented: %s %s" % (ui.name, name))
+ except:
+ print("Undocumented: %s %s" % (ui.name, name))
+ elif child.type == 'level':
+ h = help.help_level(name)
+ if h.generated:
+ print("Undocumented: %s %s" % (ui.name, name))
+ check_help(child.level)
+
+check_help(Root())