Class: Nauvisian::CLI::Commands::Save::Mod::List
- Inherits:
-
Dry::CLI::Command
- Object
- Dry::CLI::Command
- Nauvisian::CLI::Commands::Save::Mod::List
- Includes:
- MessageHelper
- Defined in:
- lib/nauvisian/cli/commands/save/mod/list.rb
Instance Method Summary collapse
Instance Method Details
#call(file:, **options) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/nauvisian/cli/commands/save/mod/list.rb', line 18 def call(file:, **) file_path = Pathname(file) save = Nauvisian::Save.load(file_path) mods = save.mods.sort rows = mods.map {|mod, version| {"Name" => mod.name, "Version" => version} } lister = Nauvisian::CLI::Lister.for([:format].to_sym).new(%w(Name Version)) lister.list(rows) rescue => e (e) exit 1 end |