flags_legacy.go 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // Copyright 2020 The go-ethereum Authors
  2. // This file is part of go-ethereum.
  3. //
  4. // go-ethereum is free software: you can redistribute it and/or modify
  5. // it under the terms of the GNU General Public License as published by
  6. // the Free Software Foundation, either version 3 of the License, or
  7. // (at your option) any later version.
  8. //
  9. // go-ethereum is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU General Public License
  15. // along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
  16. package utils
  17. import (
  18. "fmt"
  19. "github.com/ethereum/go-ethereum/eth/ethconfig"
  20. "github.com/ethereum/go-ethereum/internal/flags"
  21. "github.com/urfave/cli/v2"
  22. )
  23. var ShowDeprecated = &cli.Command{
  24. Action: showDeprecated,
  25. Name: "show-deprecated-flags",
  26. Usage: "Show flags that have been deprecated",
  27. ArgsUsage: " ",
  28. Description: "Show flags that have been deprecated and will soon be removed",
  29. }
  30. var DeprecatedFlags = []cli.Flag{
  31. LegacyMinerGasTargetFlag,
  32. NoUSBFlag,
  33. }
  34. var (
  35. // (Deprecated May 2020, shown in aliased flags section)
  36. NoUSBFlag = &cli.BoolFlag{
  37. Name: "nousb",
  38. Usage: "Disables monitoring for and managing USB hardware wallets (deprecated)",
  39. Category: flags.DeprecatedCategory,
  40. }
  41. // (Deprecated July 2021, shown in aliased flags section)
  42. LegacyMinerGasTargetFlag = &cli.Uint64Flag{
  43. Name: "miner.gastarget",
  44. Usage: "Target gas floor for mined blocks (deprecated)",
  45. Value: ethconfig.Defaults.Miner.GasFloor,
  46. Category: flags.DeprecatedCategory,
  47. }
  48. )
  49. // showDeprecated displays deprecated flags that will be soon removed from the codebase.
  50. func showDeprecated(*cli.Context) error {
  51. fmt.Println("--------------------------------------------------------------------")
  52. fmt.Println("The following flags are deprecated and will be removed in the future!")
  53. fmt.Println("--------------------------------------------------------------------")
  54. fmt.Println()
  55. for _, flag := range DeprecatedFlags {
  56. fmt.Println(flag.String())
  57. }
  58. fmt.Println()
  59. return nil
  60. }