Skip to content

Commit a6f712c

Browse files
committed
fix: remove as required if there is a default
1 parent 1b48141 commit a6f712c

File tree

11 files changed

+3
-29
lines changed

11 files changed

+3
-29
lines changed

cmd/cdk/cdk.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,4 @@ func init() {
675675
gerCmd.AddCommand(gerInspectCmd)
676676
gerCmd.AddCommand(gerDumpCmd)
677677
gerCmd.AddCommand(gerMonitorCmd)
678-
679-
// Mark required flags
680-
flag.MarkPersistentFlagRequired(CDKCmd, flag.RPCURL)
681678
}

cmd/contract/cmd.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,5 +176,4 @@ func init() {
176176

177177
// Mark required flags
178178
flag.MarkFlagRequired(Cmd, ArgAddress)
179-
flag.MarkFlagRequired(Cmd, flag.RPCURL)
180179
}

cmd/dumpblocks/dumpblocks.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,6 @@ func init() {
194194
f.StringVarP(&inputDumpblocks.Mode, "mode", "m", "json", "the output format [json, proto]")
195195
f.Uint64VarP(&inputDumpblocks.BatchSize, "batch-size", "b", 150, "batch size for requests (most providers cap at 1000)")
196196
f.StringVarP(&inputDumpblocks.FilterStr, "filter", "F", "{}", "filter output based on tx to and from, not setting a filter means all are allowed")
197-
198-
// Mark required flags
199-
flag.MarkFlagRequired(DumpblocksCmd, flag.RPCURL)
200197
}
201198

202199
// writeResponses writes the data to either stdout or a file if one is provided.

cmd/fixnoncegap/fixnoncegap.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ func init() {
233233
f.Uint64Var(&inputFixNonceGapArgs.maxNonce, ArgMaxNonce, 0, "override max nonce value instead of getting it from the pool")
234234

235235
// Mark required flags
236-
flag.MarkFlagRequired(FixNonceGapCmd, flag.RPCURL)
237236
flag.MarkFlagRequired(FixNonceGapCmd, flag.PrivateKey)
238237
}
239238

cmd/fund/cmd.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,6 @@ func init() {
8989
// Require at least one method to specify target accounts
9090
FundCmd.MarkFlagsOneRequired("addresses", "key-file", "number")
9191

92-
// Mark required flags
93-
flag.MarkFlagRequired(FundCmd, flag.RPCURL)
94-
flag.MarkFlagRequired(FundCmd, flag.PrivateKey)
95-
9692
// Funder contract parameters.
9793
f.StringVar(&params.FunderAddress, "contract-address", "", "address of pre-deployed Funder contract")
9894
}

cmd/loadtest/app.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,10 +297,6 @@ v3, uniswapv3 - perform UniswapV3 swaps`)
297297
f.UintVar(&ltp.ReceiptRetryInitialDelayMs, "receipt-retry-initial-delay-ms", 100, "initial delay in milliseconds for receipt polling (uses exponential backoff with jitter)")
298298

299299
// TODO Compression
300-
301-
// Mark required flags
302-
flag.MarkPersistentFlagRequired(LoadtestCmd, flag.RPCURL)
303-
flag.MarkPersistentFlagRequired(LoadtestCmd, flag.PrivateKey)
304300
}
305301

306302
func initSubCommands() {

cmd/metricsToDash/metricsToDash.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package metricsToDash
1+
package metricstodash
22

33
import (
44
"fmt"

cmd/monitor/cmd.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,6 @@ func init() {
8888
f.IntVarP(&subBatchSize, "sub-batch-size", "s", 50, "number of requests per sub-batch")
8989
f.IntVarP(&blockCacheLimit, "cache-limit", "c", 200, "number of cached blocks for the LRU block data structure (Min 100)")
9090
f.StringVarP(&intervalStr, "interval", "i", "5s", "amount of time between batch block RPC calls")
91-
92-
// Mark required flags
93-
flag.MarkFlagRequired(MonitorCmd, flag.RPCURL)
9491
}
9592

9693
func checkFlags() (err error) {

cmd/publish/publish.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,4 @@ func init() {
143143
f.Uint64Var(&publishInputArgs.jobQueueSize, "job-queue-size", 100, "number of jobs we can put in the job queue for workers to process")
144144
f.StringVar(&publishInputArgs.inputFileName, "file", "", "provide a filename with transactions to publish")
145145
f.Uint64Var(&publishInputArgs.rateLimit, "rate-limit", 0, "rate limit in txs per second (default: no limit)")
146-
147-
// Mark required flags
148-
flag.MarkFlagRequired(Cmd, flag.RPCURL)
149146
}

cmd/root.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import (
3232
"github.com/0xPolygon/polygon-cli/cmd/fund"
3333
"github.com/0xPolygon/polygon-cli/cmd/hash"
3434
"github.com/0xPolygon/polygon-cli/cmd/loadtest"
35-
"github.com/0xPolygon/polygon-cli/cmd/metricsToDash"
35+
"github.com/0xPolygon/polygon-cli/cmd/metricstodash"
3636
"github.com/0xPolygon/polygon-cli/cmd/mnemonic"
3737
"github.com/0xPolygon/polygon-cli/cmd/monitor"
3838
"github.com/0xPolygon/polygon-cli/cmd/monitorv2"
@@ -153,7 +153,7 @@ func NewPolycliCommand() *cobra.Command {
153153
fund.FundCmd,
154154
hash.HashCmd,
155155
loadtest.LoadtestCmd,
156-
metricsToDash.MetricsToDashCmd,
156+
metricstodash.MetricsToDashCmd,
157157
mnemonic.MnemonicCmd,
158158
monitor.MonitorCmd,
159159
monitorv2.MonitorV2Cmd,

0 commit comments

Comments
 (0)