Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Commit 9dba49b

Browse files
committed
Rename remote command 'help' string to 'argument description'
Previous name was not clear as the help of a command can be many thing. This patch renames it 'argument description' as it describe exactly what we are waiting. Signed-off-by: Jules Clero <julesx.clero@intel.com>
1 parent a478031 commit 9dba49b

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

remote-processor/RemoteCommandHandlerTemplate.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,16 @@ class RemoteCommandHandlerTemplate : public IRemoteCommandHandler
6969
/**
7070
* @param parser command handler callback
7171
* @param minArgumentCount command required arguments number
72-
* @param help string containing command help
72+
* @param argumentDescription string containing the description of each command argument
7373
* @param description string containing command description
7474
*/
7575
RemoteCommandParserItem(RemoteCommandParser parser,
7676
uint32_t minArgumentCount,
77-
const std::string& help,
77+
const std::string& argumentDescription,
7878
const std::string& description) :
7979
mParser(parser),
8080
mMinArgumentCount(minArgumentCount),
81-
mHelp(help),
81+
mArgumentDescription(argumentDescription),
8282
mDescription(description)
8383
{
8484
}
@@ -92,13 +92,13 @@ class RemoteCommandHandlerTemplate : public IRemoteCommandHandler
9292
return mDescription;
9393
}
9494

95-
/** Command help string getter
95+
/** Description of each argument of the command
9696
*
97-
* @return the command help string
97+
* @return the command argument description string
9898
*/
99-
const std::string getHelp() const
99+
const std::string getArgumentDescription() const
100100
{
101-
return mHelp;
101+
return mArgumentDescription;
102102
}
103103

104104
/** Parse and launch a remote command
@@ -115,8 +115,8 @@ class RemoteCommandHandlerTemplate : public IRemoteCommandHandler
115115
// Check enough arguments supplied
116116
if (remoteCommand.getArgumentCount() < mMinArgumentCount) {
117117

118-
result = std::string("Not enough arguments supplied\nUsage:\n") + getHelp();
119-
118+
result = std::string("Not enough arguments supplied\nUsage:\n") +
119+
getArgumentDescription();
120120
return false;
121121
}
122122

@@ -127,7 +127,7 @@ class RemoteCommandHandlerTemplate : public IRemoteCommandHandler
127127
case ESucceeded:
128128
return true;
129129
case EShowUsage:
130-
result = getHelp();
130+
result = getArgumentDescription();
131131
// Fall through intentionally
132132
case EFailed:
133133
return false;
@@ -144,15 +144,15 @@ class RemoteCommandHandlerTemplate : public IRemoteCommandHandler
144144
/** Needed arguments number */
145145
uint32_t mMinArgumentCount;
146146

147-
/** Command help string */
148-
std::string mHelp;
147+
/** Command argument description string */
148+
std::string mArgumentDescription;
149149

150150
/** Command description string */
151151
std::string mDescription;
152152
};
153153

154154
/** Remote command parser container type */
155-
typedef std::map<std::string, RemoteCommandParserItem> RemoteCommandParserItems;
155+
using RemoteCommandParserItems = std::map<std::string, RemoteCommandParserItem>;
156156

157157
/**
158158
* @param commandParser command parser used for command handling
@@ -211,7 +211,7 @@ class RemoteCommandHandlerTemplate : public IRemoteCommandHandler
211211
size_t maxUsage = 0;
212212

213213
for (auto& item : _remoteCommandParserItems) {
214-
std::string usage = item.first + ' ' + item.second.getHelp();
214+
std::string usage = item.first + ' ' + item.second.getArgumentDescription();
215215
helps.push_back({ usage, item.second.getDescription() });
216216
maxUsage = std::max(maxUsage, usage.length());
217217
}

0 commit comments

Comments
 (0)