Resurrect the 'rules' tool.

This tool is useful for writing shell completion script for tools
expecting a rule name as argument.

The tool was dropped by 34b46f28c.

Fix #1024.
4 files changed