Class: Skit::JsonSchema::CLI

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/skit/json_schema/cli.rb

Instance Method Summary collapse

Instance Method Details

#run(args) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/skit/json_schema/cli.rb', line 13

def run(args)
  options = parse_options(args)

  # Exit normally when help or version is requested
  return 0 if options[:help_requested] || options[:version_requested]

  return 1 unless valid_args?(args)

  schema_file = T.must(args.first)
  return 1 unless valid_schema_file?(schema_file)

  process_schema(schema_file, options)
end