Open pki-bot opened 4 years ago
Comment from edewata (@edewata) at 2014-04-23 23:53:01
This can be implemented by recursively iterating through the 'modules' map in the CLI. Each node in the above tree is a subclass of CLI and the 'modules' in each node contains the children of the node. The 'modules' is a LinkedHashMap, so the insertion order is preserved (see CLI.addModule() invocations). I'd suggest we maintain this order while displaying the tree (i.e. no need to re-sort) to be consistent with CLI.printHelp().
The code may look like this:
public class CLI {
public void displayTree(int level) {
// display node
...
// display children
for (CLI module : modules.values()) {
module.displayTree(level + 1);
}
}
}
Comment from mharmsen (@mharmsen) at 2014-04-29 00:01:00
Per CS/DS meeting of 04/28/2014 - 10.3.
Comment from mharmsen (@mharmsen) at 2017-02-27 13:59:10
Metadata Update from @mharmsen:
This issue was migrated from Pagure Issue #973. Originally filed by mharmsen (@mharmsen) on 2014-04-23 01:15:56:
During the process of working on numerous CLI tickets, I have come to the conclusion that it would be highly beneficial to provide a means whereby each and every command-line available to an end user could be displayed.
I would suggest that either a new option be added to the pki command such as --commands or --tree, or a new script be included which provides a listing similar to the following:
NOTE: All commands should probably be alphabetized for consistency underneath their various tree structures.
Proposed milestone: 10.2 Backlog