Class: Wikiwiki::CLI::Commands::Page::List
- Defined in:
- lib/wikiwiki/cli/commands/page/list.rb
Overview
List all pages in the wiki
Instance Method Summary collapse
-
#call(out: $stdout, err: $stderr, **options) ⇒ void
Execute the list command.
Instance Method Details
#call(out: $stdout, err: $stderr, **options) ⇒ void
This method returns an undefined value.
Execute the list command
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/wikiwiki/cli/commands/page/list.rb', line 19 def call(out: $stdout, err: $stderr, **) wiki = create_wiki(out:, err:, **) page_names = wiki.page_names if [:json] out.puts Formatter::JSON.new.format(page_names) else page_names.each {|name| out.puts name } say("#{page_names.size} pages found", out:, **) end end |