lib/tapioca/cli.rb in tapioca-0.4.6 vs lib/tapioca/cli.rb in tapioca-0.4.7
- old
+ new
@@ -1,7 +1,7 @@
-# frozen_string_literal: true
# typed: true
+# frozen_string_literal: true
require 'thor'
module Tapioca
class Cli < Thor
@@ -32,10 +32,12 @@
aliases: ["--typed", "-t"],
type: :hash,
banner: "gem:level [gem:level ...]",
desc: "Overrides for typed sigils for generated gem RBIs"
+ map T.unsafe(%w[--version -v] => :__print_version)
+
desc "init", "initializes folder structure"
def init
create_file(Config::SORBET_CONFIG, skip: true) do
<<~CONTENT
--dir
@@ -88,9 +90,14 @@
desc "sync", "sync RBIs to Gemfile"
def sync
Tapioca.silence_warnings do
generator.sync_rbis_with_gemfile
end
+ end
+
+ desc "--version, -v", "show version"
+ def __print_version
+ puts "Tapioca v#{Tapioca::VERSION}"
end
no_commands do
def self.exit_on_failure?
true