From 21827a6b69d0f16ea43a63b59b4226f3d0f82dc3 Mon Sep 17 00:00:00 2001 From: Richard Michael Date: Fri, 30 Apr 2021 12:54:40 +0200 Subject: [PATCH] Adjust `docs:page` version handling - Remove `--version` option - Add `@|~` version notation, consistent with other commands --- lib/tasks/docs.thor | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/tasks/docs.thor b/lib/tasks/docs.thor index 958da29e..7ac6f1df 100644 --- a/lib/tasks/docs.thor +++ b/lib/tasks/docs.thor @@ -40,8 +40,7 @@ class DocsCLI < Thor TTY::Pager.new.page(output) end - desc 'page [path] [--version] [--verbose] [--debug]', 'Generate a page (no indexing)' - option :version, type: :string + desc 'page ( | ) [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]}"