From 1ded5cb42d360c806af268083791943135dba8a9 Mon Sep 17 00:00:00 2001 From: Jeeyong Um Date: Sun, 2 Sep 2018 12:30:32 +0900 Subject: [PATCH] Print separators properly with `cleos get account` --- programs/cleos/main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/programs/cleos/main.cpp b/programs/cleos/main.cpp index d7d9d6026e9..43e7bac18e3 100644 --- a/programs/cleos/main.cpp +++ b/programs/cleos/main.cpp @@ -1487,14 +1487,14 @@ void get_account( const string& accountName, bool json_format ) { std::function dfs_print = [&]( account_name name, int depth ) -> void { auto& p = cache.at(name); std::cout << indent << std::string(depth*3, ' ') << name << ' ' << std::setw(5) << p.required_auth.threshold << ": "; + const char *sep = ""; for ( auto it = p.required_auth.keys.begin(); it != p.required_auth.keys.end(); ++it ) { - if ( it != p.required_auth.keys.begin() ) { - std::cout << ", "; - } - std::cout << it->weight << ' ' << string(it->key); + std::cout << sep << it->weight << ' ' << string(it->key); + sep = ", "; } for ( auto& acc : p.required_auth.accounts ) { - std::cout << acc.weight << ' ' << string(acc.permission.actor) << '@' << string(acc.permission.permission) << ", "; + std::cout << sep << acc.weight << ' ' << string(acc.permission.actor) << '@' << string(acc.permission.permission); + sep = ", "; } std::cout << std::endl; auto it = tree.find( name );