mirror of
https://github.com/tailscale/tailscale.git
synced 2026-03-26 18:21:15 -04:00
Rather than printing `unknown subcommand: drive` for any Taildrive commands run in the macOS GUI, print an error message directing the user to the GUI client and the docs page. Updates #17210 Fixes #18823 Change-Id: I6435007b5911baee79274b56e3ee101e6bb6d809 Signed-off-by: Alex Chan <alexc@tailscale.com>
34 lines
864 B
Go
34 lines
864 B
Go
// Copyright (c) Tailscale Inc & contributors
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
//go:build !ts_omit_drive && ts_mac_gui
|
|
|
|
package cli
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
|
|
"github.com/peterbourgon/ff/v3/ffcli"
|
|
)
|
|
|
|
func init() {
|
|
maybeDriveCmd = driveCmdStub
|
|
}
|
|
|
|
func driveCmdStub() *ffcli.Command {
|
|
return &ffcli.Command{
|
|
Name: "drive",
|
|
ShortHelp: "Share a directory with your tailnet",
|
|
ShortUsage: "tailscale drive [...any]",
|
|
LongHelp: hidden + "Taildrive allows you to share directories with other machines on your tailnet.",
|
|
Exec: func(_ context.Context, args []string) error {
|
|
return errors.New(
|
|
"Taildrive CLI commands are not supported when using the macOS GUI app. " +
|
|
"Please use the Tailscale menu bar icon to configure Taildrive in Settings.\n\n" +
|
|
"See https://tailscale.com/docs/features/taildrive",
|
|
)
|
|
},
|
|
}
|
|
}
|