瀏覽代碼

Adjust `docs:page` version handling

- Remove `--version` option
- Add `@|~` version notation, consistent with other commands
Richard Michael 4 年之前
父節點
當前提交
21827a6b69
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      lib/tasks/docs.thor

+ 3 - 3
lib/tasks/docs.thor

@@ -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]}"