Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Commit

Permalink
♻️ Add Args interface
Browse files Browse the repository at this point in the history
  • Loading branch information
shuse2 committed Dec 3, 2018
1 parent 6c15627 commit cf52e54
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/commands/account/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ import BaseCommand from '../../base';
import { getAPIClient } from '../../utils/api';
import { query } from '../../utils/query';

interface Args {
readonly addresses: string;
}

export default class GetCommand extends BaseCommand {
static args = [
{
Expand All @@ -40,8 +44,9 @@ Gets account information from the blockchain.
};

async run(): Promise<void> {
const { args: { addresses: addressesStr } } = this.parse(GetCommand);
const addresses: ReadonlyArray<string> = addressesStr
const { args } = this.parse(GetCommand);
const { addresses: addressesStr }: Args = args;
const addresses = addressesStr
.split(',')
.filter(Boolean);
const req = addresses.map((address: string) => ({
Expand Down

0 comments on commit cf52e54

Please sign in to comment.