Skip to content

Commit 59a9659

Browse files
committed
Reorder chain commands so args are before flags
This creates a standard in laying our command code.
1 parent c89980c commit 59a9659

File tree

4 files changed

+25
-25
lines changed

4 files changed

+25
-25
lines changed

ironfish-cli/src/commands/chain/broadcast.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ import { RemoteFlags } from '../../flags'
88
export class BroadcastCommand extends IronfishCommand {
99
static description = 'broadcast a transaction to the network'
1010

11-
static flags = {
12-
...RemoteFlags,
13-
}
14-
1511
static args = {
1612
transaction: Args.string({
1713
required: true,
1814
description: 'The transaction in hex encoding',
1915
}),
2016
}
2117

18+
static flags = {
19+
...RemoteFlags,
20+
}
21+
2222
async start(): Promise<void> {
2323
const { args } = await this.parse(BroadcastCommand)
2424
const { transaction } = args

ironfish-cli/src/commands/chain/export.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,6 @@ import { ProgressBar } from '../../ui'
1111
export default class Export extends IronfishCommand {
1212
static description = 'export the chain to a file'
1313

14-
static flags = {
15-
...RemoteFlags,
16-
path: Flags.string({
17-
char: 'p',
18-
required: false,
19-
description: 'The path to export the chain to',
20-
}),
21-
}
22-
2314
static args = {
2415
start: Args.integer({
2516
default: Number(GENESIS_BLOCK_SEQUENCE),
@@ -32,6 +23,15 @@ export default class Export extends IronfishCommand {
3223
}),
3324
}
3425

26+
static flags = {
27+
...RemoteFlags,
28+
path: Flags.string({
29+
char: 'p',
30+
required: false,
31+
description: 'The path to export the chain to',
32+
}),
33+
}
34+
3535
async start(): Promise<void> {
3636
const { flags, args } = await this.parse(Export)
3737

ironfish-cli/src/commands/chain/power.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ export default class Power extends IronfishCommand {
1010
static description = "show the network's mining power"
1111
static enableJsonFlag = true
1212

13+
static args = {
14+
block: Args.integer({
15+
required: false,
16+
description: 'The sequence of the block to estimate network speed for',
17+
}),
18+
}
19+
1320
static flags = {
1421
...RemoteFlags,
1522
...JsonFlags,
@@ -20,13 +27,6 @@ export default class Power extends IronfishCommand {
2027
}),
2128
}
2229

23-
static args = {
24-
block: Args.integer({
25-
required: false,
26-
description: 'The sequence of the block to estimate network speed for',
27-
}),
28-
}
29-
3030
async start(): Promise<unknown> {
3131
const { flags, args } = await this.parse(Power)
3232

ironfish-cli/src/commands/chain/transactions/info.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ export class TransactionInfo extends IronfishCommand {
1212
static description = 'show transaction information'
1313
static enableJsonFlag = true
1414

15-
static flags = {
16-
...RemoteFlags,
17-
...JsonFlags,
18-
}
19-
2015
static args = {
2116
hash: Args.string({
2217
required: true,
2318
description: 'Hash of the transaction',
2419
}),
2520
}
2621

22+
static flags = {
23+
...RemoteFlags,
24+
...JsonFlags,
25+
}
26+
2727
async start(): Promise<unknown> {
2828
const { args } = await this.parse(TransactionInfo)
2929

0 commit comments

Comments
 (0)