Remove unneeded individual color flags

This commit is contained in:
Geoff Stuart 2023-01-18 23:09:10 -05:00
parent 00a73fd88f
commit 807a60b4e4
10 changed files with 11 additions and 216 deletions

View File

@ -1120,11 +1120,6 @@ var clientListRetrievalsCmd = &cli.Command{
Aliases: []string{"v"}, Aliases: []string{"v"},
Usage: "print verbose deal details", Usage: "print verbose deal details",
}, },
&cli.BoolFlag{
Name: "color",
Usage: "use color in display output",
DefaultText: "depends on output being a TTY",
},
&cli.BoolFlag{ &cli.BoolFlag{
Name: "show-failed", Name: "show-failed",
Usage: "show failed/failing deals", Usage: "show failed/failing deals",
@ -1140,10 +1135,6 @@ var clientListRetrievalsCmd = &cli.Command{
}, },
}, },
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
if cctx.IsSet("color") {
color.NoColor = !cctx.Bool("color")
}
api, closer, err := GetFullNodeAPI(cctx) api, closer, err := GetFullNodeAPI(cctx)
if err != nil { if err != nil {
return err return err
@ -1708,11 +1699,6 @@ var clientListDeals = &cli.Command{
Aliases: []string{"v"}, Aliases: []string{"v"},
Usage: "print verbose deal details", Usage: "print verbose deal details",
}, },
&cli.BoolFlag{
Name: "color",
Usage: "use color in display output",
DefaultText: "depends on output being a TTY",
},
&cli.BoolFlag{ &cli.BoolFlag{
Name: "show-failed", Name: "show-failed",
Usage: "show failed/failing deals", Usage: "show failed/failing deals",
@ -1723,10 +1709,6 @@ var clientListDeals = &cli.Command{
}, },
}, },
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
if cctx.IsSet("color") {
color.NoColor = !cctx.Bool("color")
}
api, closer, err := GetFullNodeAPI(cctx) api, closer, err := GetFullNodeAPI(cctx)
if err != nil { if err != nil {
return err return err
@ -2238,11 +2220,6 @@ var clientListTransfers = &cli.Command{
Aliases: []string{"v"}, Aliases: []string{"v"},
Usage: "print verbose transfer details", Usage: "print verbose transfer details",
}, },
&cli.BoolFlag{
Name: "color",
Usage: "use color in display output",
DefaultText: "depends on output being a TTY",
},
&cli.BoolFlag{ &cli.BoolFlag{
Name: "completed", Name: "completed",
Usage: "show completed data transfers", Usage: "show completed data transfers",
@ -2257,10 +2234,6 @@ var clientListTransfers = &cli.Command{
}, },
}, },
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
if cctx.IsSet("color") {
color.NoColor = !cctx.Bool("color")
}
api, closer, err := GetFullNodeAPI(cctx) api, closer, err := GetFullNodeAPI(cctx)
if err != nil { if err != nil {
return err return err

View File

@ -433,17 +433,8 @@ var actorControlList = &cli.Command{
&cli.BoolFlag{ &cli.BoolFlag{
Name: "verbose", Name: "verbose",
}, },
&cli.BoolFlag{
Name: "color",
Usage: "use color in display output",
DefaultText: "depends on output being a TTY",
},
}, },
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
if cctx.IsSet("color") {
color.NoColor = !cctx.Bool("color")
}
minerApi, closer, err := lcli.GetStorageMinerAPI(cctx) minerApi, closer, err := lcli.GetStorageMinerAPI(cctx)
if err != nil { if err != nil {
return err return err

View File

@ -31,18 +31,7 @@ var dagstoreCmd = &cli.Command{
var dagstoreListShardsCmd = &cli.Command{ var dagstoreListShardsCmd = &cli.Command{
Name: "list-shards", Name: "list-shards",
Usage: "List all shards known to the dagstore, with their current status", Usage: "List all shards known to the dagstore, with their current status",
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "color",
Usage: "use color in display output",
DefaultText: "depends on output being a TTY",
},
},
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
if cctx.IsSet("color") {
color.NoColor = !cctx.Bool("color")
}
marketsApi, closer, err := lcli.GetMarketsAPI(cctx) marketsApi, closer, err := lcli.GetMarketsAPI(cctx)
if err != nil { if err != nil {
return err return err
@ -64,18 +53,7 @@ var dagstoreRegisterShardCmd = &cli.Command{
Name: "register-shard", Name: "register-shard",
ArgsUsage: "[key]", ArgsUsage: "[key]",
Usage: "Register a shard", Usage: "Register a shard",
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "color",
Usage: "use color in display output",
DefaultText: "depends on output being a TTY",
},
},
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
if cctx.IsSet("color") {
color.NoColor = !cctx.Bool("color")
}
if cctx.NArg() != 1 { if cctx.NArg() != 1 {
return lcli.IncorrectNumArgs(cctx) return lcli.IncorrectNumArgs(cctx)
} }
@ -103,18 +81,7 @@ var dagstoreInitializeShardCmd = &cli.Command{
Name: "initialize-shard", Name: "initialize-shard",
ArgsUsage: "[key]", ArgsUsage: "[key]",
Usage: "Initialize the specified shard", Usage: "Initialize the specified shard",
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "color",
Usage: "use color in display output",
DefaultText: "depends on output being a TTY",
},
},
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
if cctx.IsSet("color") {
color.NoColor = !cctx.Bool("color")
}
if cctx.NArg() != 1 { if cctx.NArg() != 1 {
return lcli.IncorrectNumArgs(cctx) return lcli.IncorrectNumArgs(cctx)
} }
@ -135,18 +102,7 @@ var dagstoreRecoverShardCmd = &cli.Command{
Name: "recover-shard", Name: "recover-shard",
ArgsUsage: "[key]", ArgsUsage: "[key]",
Usage: "Attempt to recover a shard in errored state", Usage: "Attempt to recover a shard in errored state",
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "color",
Usage: "use color in display output",
DefaultText: "depends on output being a TTY",
},
},
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
if cctx.IsSet("color") {
color.NoColor = !cctx.Bool("color")
}
if cctx.NArg() != 1 { if cctx.NArg() != 1 {
return lcli.IncorrectNumArgs(cctx) return lcli.IncorrectNumArgs(cctx)
} }
@ -176,17 +132,8 @@ var dagstoreInitializeAllCmd = &cli.Command{
Name: "include-sealed", Name: "include-sealed",
Usage: "initialize sealed pieces as well", Usage: "initialize sealed pieces as well",
}, },
&cli.BoolFlag{
Name: "color",
Usage: "use color in display output",
DefaultText: "depends on output being a TTY",
},
}, },
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
if cctx.IsSet("color") {
color.NoColor = !cctx.Bool("color")
}
concurrency := cctx.Uint("concurrency") concurrency := cctx.Uint("concurrency")
sealed := cctx.Bool("sealed") sealed := cctx.Bool("sealed")
@ -236,18 +183,7 @@ var dagstoreInitializeAllCmd = &cli.Command{
var dagstoreGcCmd = &cli.Command{ var dagstoreGcCmd = &cli.Command{
Name: "gc", Name: "gc",
Usage: "Garbage collect the dagstore", Usage: "Garbage collect the dagstore",
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "color",
Usage: "use color in display output",
DefaultText: "depends on output being a TTY",
},
},
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
if cctx.IsSet("color") {
color.NoColor = !cctx.Bool("color")
}
marketsApi, closer, err := lcli.GetMarketsAPI(cctx) marketsApi, closer, err := lcli.GetMarketsAPI(cctx)
if err != nil { if err != nil {
return err return err
@ -317,18 +253,7 @@ var dagstoreLookupPiecesCmd = &cli.Command{
Name: "lookup-pieces", Name: "lookup-pieces",
Usage: "Lookup pieces that a given CID belongs to", Usage: "Lookup pieces that a given CID belongs to",
ArgsUsage: "<cid>", ArgsUsage: "<cid>",
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "color",
Usage: "use color in display output",
DefaultText: "depends on output being a TTY",
},
},
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
if cctx.IsSet("color") {
color.NoColor = !cctx.Bool("color")
}
if cctx.NArg() != 1 { if cctx.NArg() != 1 {
return lcli.IncorrectNumArgs(cctx) return lcli.IncorrectNumArgs(cctx)
} }

View File

@ -3,7 +3,6 @@ package main
import ( import (
"fmt" "fmt"
"github.com/fatih/color"
"github.com/ipfs/go-cid" "github.com/ipfs/go-cid"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
@ -23,18 +22,7 @@ var indexProvAnnounceCmd = &cli.Command{
Name: "announce", Name: "announce",
ArgsUsage: "<deal proposal cid>", ArgsUsage: "<deal proposal cid>",
Usage: "Announce a deal to indexers so they can download its index", Usage: "Announce a deal to indexers so they can download its index",
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "color",
Usage: "use color in display output",
DefaultText: "depends on output being a TTY",
},
},
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
if cctx.IsSet("color") {
color.NoColor = !cctx.Bool("color")
}
if cctx.NArg() != 1 { if cctx.NArg() != 1 {
return lcli.IncorrectNumArgs(cctx) return lcli.IncorrectNumArgs(cctx)
} }
@ -60,18 +48,7 @@ var indexProvAnnounceCmd = &cli.Command{
var indexProvAnnounceAllCmd = &cli.Command{ var indexProvAnnounceAllCmd = &cli.Command{
Name: "announce-all", Name: "announce-all",
Usage: "Announce all active deals to indexers so they can download the indices", Usage: "Announce all active deals to indexers so they can download the indices",
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "color",
Usage: "use color in display output",
DefaultText: "depends on output being a TTY",
},
},
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
if cctx.IsSet("color") {
color.NoColor = !cctx.Bool("color")
}
marketsApi, closer, err := lcli.GetMarketsAPI(cctx) marketsApi, closer, err := lcli.GetMarketsAPI(cctx)
if err != nil { if err != nil {
return err return err

View File

@ -16,7 +16,6 @@ import (
tm "github.com/buger/goterm" tm "github.com/buger/goterm"
"github.com/docker/go-units" "github.com/docker/go-units"
"github.com/fatih/color"
"github.com/ipfs/go-cid" "github.com/ipfs/go-cid"
"github.com/ipfs/go-cidutil/cidenc" "github.com/ipfs/go-cidutil/cidenc"
"github.com/libp2p/go-libp2p/core/peer" "github.com/libp2p/go-libp2p/core/peer"
@ -779,11 +778,6 @@ var transfersListCmd = &cli.Command{
Aliases: []string{"v"}, Aliases: []string{"v"},
Usage: "print verbose transfer details", Usage: "print verbose transfer details",
}, },
&cli.BoolFlag{
Name: "color",
Usage: "use color in display output",
DefaultText: "depends on output being a TTY",
},
&cli.BoolFlag{ &cli.BoolFlag{
Name: "completed", Name: "completed",
Usage: "show completed data transfers", Usage: "show completed data transfers",
@ -798,10 +792,6 @@ var transfersListCmd = &cli.Command{
}, },
}, },
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
if cctx.IsSet("color") {
color.NoColor = !cctx.Bool("color")
}
api, closer, err := lcli.GetMarketsAPI(cctx) api, closer, err := lcli.GetMarketsAPI(cctx)
if err != nil { if err != nil {
return err return err

View File

@ -45,18 +45,7 @@ func workersCmd(sealing bool) *cli.Command {
return &cli.Command{ return &cli.Command{
Name: "workers", Name: "workers",
Usage: "list workers", Usage: "list workers",
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "color",
Usage: "use color in display output",
DefaultText: "depends on output being a TTY",
},
},
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
if cctx.IsSet("color") {
color.NoColor = !cctx.Bool("color")
}
minerApi, closer, err := lcli.GetStorageMinerAPI(cctx) minerApi, closer, err := lcli.GetStorageMinerAPI(cctx)
if err != nil { if err != nil {
return err return err
@ -218,21 +207,12 @@ var sealingJobsCmd = &cli.Command{
Name: "jobs", Name: "jobs",
Usage: "list running jobs", Usage: "list running jobs",
Flags: []cli.Flag{ Flags: []cli.Flag{
&cli.BoolFlag{
Name: "color",
Usage: "use color in display output",
DefaultText: "depends on output being a TTY",
},
&cli.BoolFlag{ &cli.BoolFlag{
Name: "show-ret-done", Name: "show-ret-done",
Usage: "show returned but not consumed calls", Usage: "show returned but not consumed calls",
}, },
}, },
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
if cctx.IsSet("color") {
color.NoColor = !cctx.Bool("color")
}
minerApi, closer, err := lcli.GetStorageMinerAPI(cctx) minerApi, closer, err := lcli.GetStorageMinerAPI(cctx)
if err != nil { if err != nil {
return err return err

View File

@ -278,12 +278,6 @@ var sectorsListCmd = &cli.Command{
Usage: "show removed sectors", Usage: "show removed sectors",
Aliases: []string{"r"}, Aliases: []string{"r"},
}, },
&cli.BoolFlag{
Name: "color",
Usage: "use color in display output",
DefaultText: "depends on output being a TTY",
Aliases: []string{"c"},
},
&cli.BoolFlag{ &cli.BoolFlag{
Name: "fast", Name: "fast",
Usage: "don't show on-chain info for better performance", Usage: "don't show on-chain info for better performance",
@ -315,10 +309,6 @@ var sectorsListCmd = &cli.Command{
}, },
}, },
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
if cctx.IsSet("color") {
color.NoColor = !cctx.Bool("color")
}
minerApi, closer, err := lcli.GetStorageMinerAPI(cctx) minerApi, closer, err := lcli.GetStorageMinerAPI(cctx)
if err != nil { if err != nil {
return err return err

View File

@ -254,21 +254,10 @@ var storageRedeclareCmd = &cli.Command{
var storageListCmd = &cli.Command{ var storageListCmd = &cli.Command{
Name: "list", Name: "list",
Usage: "list local storage paths", Usage: "list local storage paths",
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "color",
Usage: "use color in display output",
DefaultText: "depends on output being a TTY",
},
},
Subcommands: []*cli.Command{ Subcommands: []*cli.Command{
storageListSectorsCmd, storageListSectorsCmd,
}, },
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
if cctx.IsSet("color") {
color.NoColor = !cctx.Bool("color")
}
minerApi, closer, err := lcli.GetStorageMinerAPI(cctx) minerApi, closer, err := lcli.GetStorageMinerAPI(cctx)
if err != nil { if err != nil {
return err return err
@ -633,18 +622,7 @@ var storageFindCmd = &cli.Command{
var storageListSectorsCmd = &cli.Command{ var storageListSectorsCmd = &cli.Command{
Name: "sectors", Name: "sectors",
Usage: "get list of all sector files", Usage: "get list of all sector files",
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "color",
Usage: "use color in display output",
DefaultText: "depends on output being a TTY",
},
},
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
if cctx.IsSet("color") {
color.NoColor = !cctx.Bool("color")
}
minerApi, closer, err := lcli.GetStorageMinerAPI(cctx) minerApi, closer, err := lcli.GetStorageMinerAPI(cctx)
if err != nil { if err != nil {
return err return err

View File

@ -333,7 +333,6 @@ USAGE:
lotus-miner actor control list [command options] [arguments...] lotus-miner actor control list [command options] [arguments...]
OPTIONS: OPTIONS:
--color use color in display output (default: depends on output being a TTY)
--verbose (default: false) --verbose (default: false)
``` ```
@ -980,7 +979,6 @@ USAGE:
lotus-miner data-transfers list [command options] [arguments...] lotus-miner data-transfers list [command options] [arguments...]
OPTIONS: OPTIONS:
--color use color in display output (default: depends on output being a TTY)
--completed show completed data transfers (default: false) --completed show completed data transfers (default: false)
--show-failed show failed/cancelled transfers (default: false) --show-failed show failed/cancelled transfers (default: false)
--verbose, -v print verbose transfer details (default: false) --verbose, -v print verbose transfer details (default: false)
@ -1062,7 +1060,7 @@ USAGE:
lotus-miner dagstore list-shards [command options] [arguments...] lotus-miner dagstore list-shards [command options] [arguments...]
OPTIONS: OPTIONS:
--color use color in display output (default: depends on output being a TTY) --help, -h show help (default: false)
``` ```
@ -1075,7 +1073,7 @@ USAGE:
lotus-miner dagstore register-shard [command options] [key] lotus-miner dagstore register-shard [command options] [key]
OPTIONS: OPTIONS:
--color use color in display output (default: depends on output being a TTY) --help, -h show help (default: false)
``` ```
@ -1088,7 +1086,7 @@ USAGE:
lotus-miner dagstore initialize-shard [command options] [key] lotus-miner dagstore initialize-shard [command options] [key]
OPTIONS: OPTIONS:
--color use color in display output (default: depends on output being a TTY) --help, -h show help (default: false)
``` ```
@ -1101,7 +1099,7 @@ USAGE:
lotus-miner dagstore recover-shard [command options] [key] lotus-miner dagstore recover-shard [command options] [key]
OPTIONS: OPTIONS:
--color use color in display output (default: depends on output being a TTY) --help, -h show help (default: false)
``` ```
@ -1114,7 +1112,6 @@ USAGE:
lotus-miner dagstore initialize-all [command options] [arguments...] lotus-miner dagstore initialize-all [command options] [arguments...]
OPTIONS: OPTIONS:
--color use color in display output (default: depends on output being a TTY)
--concurrency value maximum shards to initialize concurrently at a time; use 0 for unlimited (default: 0) --concurrency value maximum shards to initialize concurrently at a time; use 0 for unlimited (default: 0)
--include-sealed initialize sealed pieces as well (default: false) --include-sealed initialize sealed pieces as well (default: false)
@ -1129,7 +1126,7 @@ USAGE:
lotus-miner dagstore gc [command options] [arguments...] lotus-miner dagstore gc [command options] [arguments...]
OPTIONS: OPTIONS:
--color use color in display output (default: depends on output being a TTY) --help, -h show help (default: false)
``` ```
@ -1142,7 +1139,7 @@ USAGE:
lotus-miner dagstore lookup-pieces [command options] <cid> lotus-miner dagstore lookup-pieces [command options] <cid>
OPTIONS: OPTIONS:
--color use color in display output (default: depends on output being a TTY) --help, -h show help (default: false)
``` ```
@ -1173,7 +1170,7 @@ USAGE:
lotus-miner index announce [command options] <deal proposal cid> lotus-miner index announce [command options] <deal proposal cid>
OPTIONS: OPTIONS:
--color use color in display output (default: depends on output being a TTY) --help, -h show help (default: false)
``` ```
@ -1186,7 +1183,7 @@ USAGE:
lotus-miner index announce-all [command options] [arguments...] lotus-miner index announce-all [command options] [arguments...]
OPTIONS: OPTIONS:
--color use color in display output (default: depends on output being a TTY) --help, -h show help (default: false)
``` ```
@ -1721,7 +1718,6 @@ USAGE:
lotus-miner sectors list [command options] [arguments...] lotus-miner sectors list [command options] [arguments...]
OPTIONS: OPTIONS:
--color, -c use color in display output (default: depends on output being a TTY)
--events, -e display number of events the sector has received (default: false) --events, -e display number of events the sector has received (default: false)
--fast, -f don't show on-chain info for better performance (default: false) --fast, -f don't show on-chain info for better performance (default: false)
--initial-pledge, -p display initial pledge (default: false) --initial-pledge, -p display initial pledge (default: false)
@ -2223,7 +2219,7 @@ USAGE:
lotus-miner proving workers [command options] [arguments...] lotus-miner proving workers [command options] [arguments...]
OPTIONS: OPTIONS:
--color use color in display output (default: depends on output being a TTY) --help, -h show help (default: false)
``` ```
@ -2371,7 +2367,6 @@ COMMANDS:
help, h Shows a list of commands or help for one command help, h Shows a list of commands or help for one command
OPTIONS: OPTIONS:
--color use color in display output (default: depends on output being a TTY)
--help, -h show help (default: false) --help, -h show help (default: false)
``` ```
@ -2385,7 +2380,7 @@ USAGE:
lotus-miner storage list sectors [command options] [arguments...] lotus-miner storage list sectors [command options] [arguments...]
OPTIONS: OPTIONS:
--color use color in display output (default: depends on output being a TTY) --help, -h show help (default: false)
``` ```
@ -2458,7 +2453,6 @@ USAGE:
lotus-miner sealing jobs [command options] [arguments...] lotus-miner sealing jobs [command options] [arguments...]
OPTIONS: OPTIONS:
--color use color in display output (default: depends on output being a TTY)
--show-ret-done show returned but not consumed calls (default: false) --show-ret-done show returned but not consumed calls (default: false)
``` ```
@ -2472,7 +2466,7 @@ USAGE:
lotus-miner sealing workers [command options] [arguments...] lotus-miner sealing workers [command options] [arguments...]
OPTIONS: OPTIONS:
--color use color in display output (default: depends on output being a TTY) --help, -h show help (default: false)
``` ```

View File

@ -686,7 +686,6 @@ CATEGORY:
RETRIEVAL RETRIEVAL
OPTIONS: OPTIONS:
--color use color in display output (default: depends on output being a TTY)
--completed show completed retrievals (default: false) --completed show completed retrievals (default: false)
--show-failed show failed/failing deals (default: true) --show-failed show failed/failing deals (default: true)
--verbose, -v print verbose deal details (default: false) --verbose, -v print verbose deal details (default: false)
@ -757,7 +756,6 @@ CATEGORY:
STORAGE STORAGE
OPTIONS: OPTIONS:
--color use color in display output (default: depends on output being a TTY)
--show-failed show failed/failing deals (default: false) --show-failed show failed/failing deals (default: false)
--verbose, -v print verbose deal details (default: false) --verbose, -v print verbose deal details (default: false)
--watch watch deal updates in real-time, rather than a one time list (default: false) --watch watch deal updates in real-time, rather than a one time list (default: false)
@ -890,7 +888,6 @@ CATEGORY:
UTIL UTIL
OPTIONS: OPTIONS:
--color use color in display output (default: depends on output being a TTY)
--completed show completed data transfers (default: false) --completed show completed data transfers (default: false)
--show-failed show failed/cancelled transfers (default: false) --show-failed show failed/cancelled transfers (default: false)
--verbose, -v print verbose transfer details (default: false) --verbose, -v print verbose transfer details (default: false)