awscontainer.go 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright (C) 2019 Nicola Murino
  2. //
  3. // This program is free software: you can redistribute it and/or modify
  4. // it under the terms of the GNU Affero General Public License as published
  5. // by the Free Software Foundation, version 3.
  6. //
  7. // This program is distributed in the hope that it will be useful,
  8. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. // GNU Affero General Public License for more details.
  11. //
  12. // You should have received a copy of the GNU Affero General Public License
  13. // along with this program. If not, see <https://www.gnu.org/licenses/>.
  14. //go:build awscontainer
  15. // +build awscontainer
  16. package cmd
  17. import (
  18. "github.com/spf13/cobra"
  19. "github.com/spf13/viper"
  20. )
  21. func addAWSContainerFlags(cmd *cobra.Command) {
  22. viper.SetDefault("disable_aws_installation_code", false)
  23. viper.BindEnv("disable_aws_installation_code", "SFTPGO_DISABLE_AWS_INSTALLATION_CODE") //nolint:errcheck
  24. cmd.Flags().BoolVar(&disableAWSInstallationCode, "disable-aws-installation-code", viper.GetBool("disable_aws_installation_code"),
  25. `Disable installation code for the AWS container.
  26. This flag can be set using
  27. SFTPGO_DISABLE_AWS_INSTALLATION_CODE env var too.
  28. `)
  29. viper.BindPFlag("disable_aws_installation_code", cmd.Flags().Lookup("disable-aws-installation-code")) //nolint:errcheck
  30. }