Adjust docs:page version handling

- Remove `--version` option
- Add `@|~` version notation, consistent with other commands
This commit is contained in:
Richard Michael 2021-04-30 12:54:40 +02:00
parent 26a1e61a42
commit 21827a6b69

View file

@ -40,8 +40,7 @@ class DocsCLI < Thor
TTY::Pager.new.page(output)
end
desc 'page <doc> [path] [--version] [--verbose] [--debug]', 'Generate a page (no indexing)'
option :version, type: :string
desc 'page (<doc> | <doc@version>) [path] [--verbose] [--debug]', 'Generate a page (no indexing)'
option :verbose, type: :boolean
option :debug, type: :boolean
def page(name, path = '')
@ -56,7 +55,8 @@ class DocsCLI < Thor
Docs.install_report :filter, :request, :doc
end
if Docs.generate_page(name, options[:version], path)
name, version = name.split(/@|~/)
if Docs.generate_page(name, version, path)
puts 'Done'
else
puts "Failed!#{' (try running with --debug for more information)' unless options[:debug]}"