Skip to content

Comments

Preliminary --format argument#15

Open
Tunas1337 wants to merge 4 commits intowhoeverest:mainfrom
Tunas1337:main
Open

Preliminary --format argument#15
Tunas1337 wants to merge 4 commits intowhoeverest:mainfrom
Tunas1337:main

Conversation

@Tunas1337
Copy link

@Tunas1337 Tunas1337 commented Mar 29, 2021

Currently, it only works for nlbcli accounts [id] balance, but it can easily be made to work as an argument for any command, as long as the print statements are replaced with formatter.OutputResult() or something similar.
Because it only works for accounts [id] balance, OutputResult is hardwired to do the print statements for that operation, although I am working on a way to pass it a dictionary of values to be printed instead so as to universalize it.
Feedback is of course appreciated, and so are contributions/commits.

Demonstration of current capabilities:
Screenshot_20210329_140751

json_output = json.dumps(txns,indent=4)
print(json_output)
elif output_format == 'csv':
if input_type == "accounts":
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you handle transactions here also? The nlbcli accounts XXX transactions --format csv doesn't print anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants