class Makit::Cli::NewCommand

Define the ‘new’ subcommand

def execute

def execute
  if list?
    puts "Available types:"
    AVAILABLE_TYPES.each { |t| puts "  - #{t}" }
  else
    if type.nil? || name.nil?
      puts "Error: TYPE and NAME are required unless using --list"
      exit(1)
    end
    unless AVAILABLE_TYPES.include?(type)
      puts "Error: '#{type}' is not a valid type. Use --list to see available types."
      exit(1)
    end
    puts "Creating a new #{type} named #{name}."
  end
end