<commit_before>// Copyright 2013 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.

package ssh

import (
	"os/exec"
)

type Option []string

var AllocateTTY Option = []string{"-t"}

var commonOptions = []string{"-o", "StrictHostKeyChecking no"}

func Command(host string, command string, options ...Option) *exec.Cmd {
	args := append([]string{}, commonOptions...)
	for _, option := range options {
		args = append(args, option...)
	}
	args = append(args, host, "--", command)
	return exec.Command("ssh", args...)
}<commit_msg>Address review comments<commit_after>// Copyright 2013 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.

package ssh

import (
	"os/exec"
)

type Option []string

var (
	commonOptions Option = []string{"-o", "StrictHostKeyChecking no"}

	// AllocateTTY forces pseudo-TTY allocation, which is required,
	// for example, for sudo password prompts on the target host.
	AllocateTTY Option = []string{"-t"}

	// NoPasswordAuthentication disallows password-based authentication.
	NoPasswordAuthentication Option = []string{"-o", "PasswordAuthentication no"}
)

// Command initialises an os/exec.Cmd to execute the native ssh program.
func Command(host string, command []string, options ...Option) *exec.Cmd {
	args := append([]string{}, commonOptions...)
	for _, option := range options {
		args = append(args, option...)
	}
	args = append(args, host)
	if len(command) > 0 {
		args = append(args, "--")
		args = append(args, command...)
	}
	return exec.Command("ssh", args...)
}

// ScpCommand initialises an os/exec.Cmd to execute the native scp program.
func ScpCommand(source, destination string, options ...Option) *exec.Cmd {
	args := append([]string{}, commonOptions...)
	for _, option := range options {
		args = append(args, option...)
	}
	args = append(args, source, destination)
	return exec.Command("scp", args...)
}
{'fraction_non_alphanumeric': 0.14789473684210527, 'fraction_numerical': 0.005789473684210527, 'mean_word_length': 4.042440318302387, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3245357', 'n_tokens_mistral': 589, 'n_tokens_neox': 563, 'n_words': 189}