- # Build the command to run
- command = "/usr/bin/psql --cluster #{@cluster} #{args.join(' ')} #{database}"
+ # Add any SQL command to execute
+ if options[:command]
+ args.push("--command")
+ args.push(options[:command])
+ end
+
+ # Add any file to execute SQL commands from
+ if options[:file]
+ args.push("--file")
+ args.push(options[:file])
+ end
+
+ # Add the database name
+ args.push(options[:database] || "template1")