Class: Webgen::CLI::ShowTreeCommand
- Inherits:
-
CmdParse::Command
- Object
- CmdParse::Command
- Webgen::CLI::ShowTreeCommand
- Defined in:
- lib/webgen/cli/commands/show_tree.rb
Overview
The CLI command for showing the node tree.
Instance Method Summary collapse
-
#execute(selector = nil) ⇒ Object
:nodoc:.
-
#initialize ⇒ ShowTreeCommand
constructor
:nodoc:.
Constructor Details
#initialize ⇒ ShowTreeCommand
:nodoc:
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/webgen/cli/commands/show_tree.rb', line 11 def initialize # :nodoc: super('tree', takes_commands: false) short_desc('Show the node tree') long_desc("Shows the internal representation of all destination paths that have been created\nfrom the source paths. Additionally, the meta information associated with each\nnode can be shown as well.\n\nThis command can be used before or after the website has been generated. Note,\nhowever, that nodes that are created during generation like fragment nodes can\nonly be shown if the website has been generated.\n\nDue to the way webgen works this command may take some time before actually\nshowing the tree because it has to be built first.\n\nIf an argument is given, only those nodes that have the argument in their LCN\nare displayed.\n\nHint: The global verbosity option enables additional output.\n") do |opts| opts.on("-a", "--alcn", "Use ALCN insted of LCN for paths") do |v| @use_alcn = true end opts.on("-f", "--[no-]fragments", "Show fragment nodes (default: no)") do |v| @show_fragments = v end opts.on("-m", "--[no-]meta-info", "Show meta information (default: no)") do |v| = v end end = false @use_alcn = false @show_fragments = false end |
Instance Method Details
#execute(selector = nil) ⇒ Object
:nodoc:
47 48 49 50 51 |
# File 'lib/webgen/cli/commands/show_tree.rb', line 47 def execute(selector = nil) # :nodoc: command_parser.website.ext.path_handler.populate_tree data = collect_data(command_parser.website.tree.dummy_root.children, selector) print_tree(data, selector) end |