mirror of
https://github.com/tailscale/tailscale.git
synced 2025-01-10 10:03:43 +00:00
aecb0ab76b
updates tailscale/corp#24197 tailmac run now supports the --share option which will allow you to specify a directory on the host which can be mounted in the guest using mount_virtiofs vmshare <path>. Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
33 lines
820 B
Swift
33 lines
820 B
Swift
// Copyright (c) Tailscale Inc & AUTHORS
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
import Cocoa
|
|
import Foundation
|
|
import Virtualization
|
|
import ArgumentParser
|
|
|
|
@main
|
|
struct HostCli: ParsableCommand {
|
|
static var configuration = CommandConfiguration(
|
|
abstract: "A utility for running virtual machines",
|
|
subcommands: [Run.self],
|
|
defaultSubcommand: Run.self)
|
|
}
|
|
|
|
var config: Config = Config()
|
|
|
|
extension HostCli {
|
|
struct Run: ParsableCommand {
|
|
@Option var id: String
|
|
@Option var share: String?
|
|
|
|
mutating func run() {
|
|
config = Config(id)
|
|
config.sharedDir = share
|
|
print("Running vm with identifier \(id) and sharedDir \(share ?? "<none>")")
|
|
_ = NSApplicationMain(CommandLine.argc, CommandLine.unsafeArgv)
|
|
}
|
|
}
|
|
}
|
|
|