github.com/keybase/client/go@v0.0.0-20241007131713-f10651d043c8/kbfs/libfuse/platform_flags_osx.go (about)

     1  // Copyright 2016 Keybase Inc. All rights reserved.
     2  // Use of this source code is governed by a BSD
     3  // license that can be found in the LICENSE file.//
     4  //
     5  //go:build darwin
     6  // +build darwin
     7  
     8  package libfuse
     9  
    10  import "flag"
    11  
    12  // PlatformParams contains all platform-specific parameters to be
    13  // passed to New{Default,Force}Mounter.
    14  type PlatformParams struct {
    15  	UseSystemFuse bool
    16  	UseLocal      bool
    17  }
    18  
    19  func (p PlatformParams) shouldAppendPlatformRootDirs() bool {
    20  	return p.UseLocal
    21  }
    22  
    23  // GetPlatformUsageString returns a string to be included in a usage
    24  // string corresponding to the flags added by AddPlatformFlags.
    25  func GetPlatformUsageString() string {
    26  	return "[--use-system-fuse] [--local-experimental]\n    "
    27  }
    28  
    29  // AddPlatformFlags adds platform-specific flags to the given FlagSet
    30  // and returns a PlatformParams object that will be filled in when the
    31  // given FlagSet is parsed.
    32  func AddPlatformFlags(flags *flag.FlagSet) *PlatformParams {
    33  	var params PlatformParams
    34  	flags.BoolVar(&params.UseSystemFuse, "use-system-fuse", false,
    35  		"Use the system OSXFUSE instead of keybase's OSXFUSE")
    36  	flags.BoolVar(&params.UseLocal, "local-experimental", false,
    37  		"Use 'local' mount option and enable other hacky stuff for testing macOS "+
    38  			"apps. The \"hacky stuff\" includes a Trash implementation that only "+
    39  			"works for the user's own private TLF, so if you enable this please "+
    40  			"only work under your own private TLF.")
    41  	return &params
    42  }