mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-20 00:30:20 +00:00
make CLI output use singular/plural when appropriate (bug #4654)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6047 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -202,7 +202,7 @@ static int group_show_channels(int fd, int argc, char *argv[])
|
||||
if (havepattern)
|
||||
regfree(®exbuf);
|
||||
|
||||
ast_cli(fd, "%d active channel(s)\n", numchans);
|
||||
ast_cli(fd, "%d active channel%s\n", numchans, (numchans != 1) ? "s" : "");
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ static int read_exec(struct ast_channel *chan, void *data)
|
||||
tries--;
|
||||
if (option_verbose > 2) {
|
||||
if (tries)
|
||||
ast_verbose(VERBOSE_PREFIX_3 "User entered nothing, %d chance(s) left\n", tries);
|
||||
ast_verbose(VERBOSE_PREFIX_3 "User entered nothing, %d chance%s left\n", tries, (tries != 1) ? "s" : "");
|
||||
else
|
||||
ast_verbose(VERBOSE_PREFIX_3 "User entered nothing.\n");
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ static int cli_update_realtime(int fd, int argc, char **argv) {
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
ast_cli(fd, "Updated %d RealTime record(s).\n", res);
|
||||
ast_cli(fd, "Updated %d RealTime record%s.\n", res, (res != 1) ? "s" : "");
|
||||
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user