github.com/minio/mc@v0.0.0-20240503112107-b471de8d1882/cmd/flags.go (about)

     1  // Copyright (c) 2015-2022 MinIO, Inc.
     2  //
     3  // This file is part of MinIO Object Storage stack
     4  //
     5  // This program is free software: you can redistribute it and/or modify
     6  // it under the terms of the GNU Affero General Public License as published by
     7  // the Free Software Foundation, either version 3 of the License, or
     8  // (at your option) any later version.
     9  //
    10  // This program is distributed in the hope that it will be useful
    11  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    12  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    13  // GNU Affero General Public License for more details.
    14  //
    15  // You should have received a copy of the GNU Affero General Public License
    16  // along with this program.  If not, see <http://www.gnu.org/licenses/>.
    17  
    18  package cmd
    19  
    20  import (
    21  	"time"
    22  
    23  	"github.com/minio/cli"
    24  )
    25  
    26  const envPrefix = "MC_"
    27  
    28  // Collection of mc flags currently supported
    29  var globalFlags = []cli.Flag{
    30  	cli.StringFlag{
    31  		Name:   "config-dir, C",
    32  		Value:  mustGetMcConfigDir(),
    33  		Usage:  "path to configuration folder",
    34  		EnvVar: envPrefix + "CONFIG_DIR",
    35  	},
    36  	cli.BoolFlag{
    37  		Name:   "quiet, q",
    38  		Usage:  "disable progress bar display",
    39  		EnvVar: envPrefix + "QUIET",
    40  	},
    41  	cli.BoolFlag{
    42  		Name:   "disable-pager, dp",
    43  		Usage:  "disable mc internal pager and print to raw stdout",
    44  		EnvVar: envPrefix + globalDisablePagerEnv,
    45  		Hidden: true,
    46  	},
    47  	cli.BoolFlag{
    48  		Name:   "no-color",
    49  		Usage:  "disable color theme",
    50  		EnvVar: envPrefix + "NO_COLOR",
    51  	},
    52  	cli.BoolFlag{
    53  		Name:   "json",
    54  		Usage:  "enable JSON lines formatted output",
    55  		EnvVar: envPrefix + "JSON",
    56  	},
    57  	cli.BoolFlag{
    58  		Name:   "debug",
    59  		Usage:  "enable debug output",
    60  		EnvVar: envPrefix + "DEBUG",
    61  	},
    62  	cli.BoolFlag{
    63  		Name:   "insecure",
    64  		Usage:  "disable SSL certificate verification",
    65  		EnvVar: envPrefix + "INSECURE",
    66  	},
    67  	cli.StringFlag{
    68  		Name:   "limit-upload",
    69  		Usage:  "limits uploads to a maximum rate in KiB/s, MiB/s, GiB/s. (default: unlimited)",
    70  		EnvVar: envPrefix + "LIMIT_UPLOAD",
    71  	},
    72  	cli.StringFlag{
    73  		Name:   "limit-download",
    74  		Usage:  "limits downloads to a maximum rate in KiB/s, MiB/s, GiB/s. (default: unlimited)",
    75  		EnvVar: envPrefix + "LIMIT_DOWNLOAD",
    76  	},
    77  	cli.DurationFlag{
    78  		Name:   "conn-read-deadline",
    79  		Usage:  "custom connection READ deadline",
    80  		Hidden: true,
    81  		Value:  10 * time.Minute,
    82  	},
    83  	cli.DurationFlag{
    84  		Name:   "conn-write-deadline",
    85  		Usage:  "custom connection WRITE deadline",
    86  		Hidden: true,
    87  		Value:  10 * time.Minute,
    88  	},
    89  }
    90  
    91  // bundled encryption flags
    92  var encFlags = []cli.Flag{
    93  	encCFlag,
    94  	encKSMFlag,
    95  	encS3Flag,
    96  }
    97  
    98  var encCFlag = cli.StringSliceFlag{
    99  	Name:  "enc-c",
   100  	Usage: "encrypt/decrypt objects using client provided keys. (multiple keys can be provided) Format: Raw base64 encoding.",
   101  }
   102  
   103  var encKSMFlag = cli.StringSliceFlag{
   104  	Name:   "enc-kms",
   105  	Usage:  "encrypt/decrypt objects using specific server-side encryption keys. (multiple keys can be provided)",
   106  	EnvVar: envPrefix + "ENC_KMS",
   107  }
   108  
   109  var encS3Flag = cli.StringSliceFlag{
   110  	Name:   "enc-s3",
   111  	Usage:  "encrypt/decrypt objects using server-side default keys and configurations. (multiple keys can be provided).",
   112  	EnvVar: envPrefix + "ENC_S3",
   113  }