#!/usr/bin/env ruby require 'commander/import' require 'swift_generator' # assistant = Objc2swiftAssistant::Assistant.new # assistant.runFromCommandLine program :name, 'genswift' program :version, '1.0.0' program :description, 'Basic CLI interface to the swift_generator gem' command :generate do |c| c.syntax = 'genswift specfile' c.description = 'Generate Swift files based upon a JSON specification file.' c.option '--out STRING', String, 'The root of the generated Swift source. Overrides the setting in the spec file.' c.action do |args, options| options.default :out => nil if args.size == 1 a = SwiftGenerator::Generator.new( Pathname.new(args[0]), options.out ) a.generate() elsif args.size > 1 puts( "specfile must be specified" ) else puts( "more than one argument provided to command" ) end end end default_command :generate # end