summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2009-09-24 23:46:54 +0200
committerMatthias Schiffer <matthias@gamezock.de>2009-09-24 23:46:54 +0200
commit8c6ea75e487172e23822b39b6cf58fbc947971e4 (patch)
tree22fdd79d6e4eac882f8071b22d66c17f091ae40c /src
parent9f962123be30da94add3f966bb46962f8bfdea88 (diff)
downloadmad-8c6ea75e487172e23822b39b6cf58fbc947971e4.tar
mad-8c6ea75e487172e23822b39b6cf58fbc947971e4.zip
UserListCommands: Just some formatting changes
Diffstat (limited to 'src')
-rw-r--r--src/Client/UserListCommands.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/Client/UserListCommands.cpp b/src/Client/UserListCommands.cpp
index 420202e..ad0c2d0 100644
--- a/src/Client/UserListCommands.cpp
+++ b/src/Client/UserListCommands.cpp
@@ -202,34 +202,45 @@ void UserListCommands::showListCommand(CommandParser *commandParser, const std::
}
}
+ std::cout << " ";
printPadded(USER_NAME, lengths.find(USER_NAME)->second);
+ std::cout << " ";
printPadded(GROUP_NAME, lengths.find(GROUP_NAME)->second);
for(std::set<std::string>::iterator detail = details.begin(); detail != details.end(); ++detail) {
+ std::cout << " ";
printPadded(*detail, lengths.find(*detail)->second);
}
std::cout << std::endl;
+ std::cout << "-";
printDelimiter(lengths.find(USER_NAME)->second);
+ std::cout << "- -";
printDelimiter(lengths.find(GROUP_NAME)->second);
for(std::set<std::string>::iterator detail = details.begin(); detail != details.end(); ++detail) {
+ std::cout << "- -";
printDelimiter(lengths.find(*detail)->second);
}
- std::cout << std::endl;
+ std::cout << "-" << std::endl;
for(Common::UserLists::UserList::iterator user = userList->begin(); user != userList->end(); ++user) {
static const std::string UNSET("<unset>");
+ std::cout << " ";
+
if(!user->getName().empty())
printPadded(user->getName(), lengths.find(USER_NAME)->second);
else
printPadded(UNSET, lengths.find(USER_NAME)->second);
+ std::cout << " ";
+
if(!user->getGroup().empty())
printPadded(user->getGroup(), lengths.find(GROUP_NAME)->second);
else
printPadded(UNSET, lengths.find(GROUP_NAME)->second);
for(std::set<std::string>::iterator detail = details.begin(); detail != details.end(); ++detail) {
+ std::cout << " ";
printPadded(user->getDetail(*detail), lengths.find(*detail)->second);
}
@@ -247,11 +258,9 @@ void UserListCommands::showListCommand(CommandParser *commandParser, const std::
}
void UserListCommands::printPadded(const std::string &str, unsigned length) {
- static const int EXTRA_PADDING = 3;
-
std::cout << str;
- if(str.length() < length + EXTRA_PADDING)
- std::cout << std::string(length-str.length()+EXTRA_PADDING, ' ');
+ if(str.length() < length)
+ std::cout << std::string(length-str.length(), ' ');
}
void UserListCommands::printDelimiter(unsigned length) {