Skip to content

Commit

Permalink
Make usage of -t<timeout> option consistent for C and Python client
Browse files Browse the repository at this point in the history
  • Loading branch information
RonIovine committed Jul 5, 2019
1 parent 3f97766 commit c64a1fe
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,8 @@ wrapper.
The usage of the "pshell" and "pshell.exp" (see NOTE) command line client
programs are as follows:

Usage: pshell -n | -l | [-t<timeout>] {{{<hostName | ipAddr>} {<portNum> | <udpServerName>}} | <unixServerName> | <serverIndex}
[{{-c <command> | -f <filename>} [rate=<seconds>] [repeat=<count>] [clear]}]
Usage: pshell -n | -l | {{{<hostName | ipAddr>} {<portNum> | <udpServerName>}} | <unixServerName> | <serverIndex} [-t<timeout>]
[{{-c <command> | -f <filename>} [rate=<seconds>] [repeat=<count>] [clear]}]

where:

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ a `-h` to show the usage as follows:
```
$ pshell -h
Usage: pshell -n | -l | [-t<timeout>] {{{<hostName | ipAddr>} {<portNum> | <udpServerName>}} | <unixServerName> | <serverIndex}
[{{-c <command> | -f <filename>} [rate=<seconds>] [repeat=<count>] [clear]}]
Usage: pshell -n | -l | {{{<hostName | ipAddr>} {<portNum> | <udpServerName>}} | <unixServerName> | <serverIndex} [-t<timeout>]
[{{-c <command> | -f <filename>} [rate=<seconds>] [repeat=<count>] [clear]}]
where:
Expand Down
Binary file modified c/bin/pshell
Binary file not shown.
38 changes: 19 additions & 19 deletions c/src/PshellClient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1461,8 +1461,8 @@ void showCommands(void)
void showUsage(void)
{
printf("\n");
printf("Usage: pshell -n | -l | [-t<timeout>] {{{<hostName | ipAddr>} {<portNum> | <udpServerName>}} | <unixServerName> | <serverIndex}\n");
printf(" [{{-c <command> | -f <filename>} [rate=<seconds>] [repeat=<count>] [clear]}]\n");
printf("Usage: pshell -n | -l | {{{<hostName | ipAddr>} {<portNum> | <udpServerName>}} | <unixServerName> | <serverIndex} [-t<timeout>]\n");
printf(" [{{-c <command> | -f <filename>} [rate=<seconds>] [repeat=<count>] [clear]}]\n");
printf("\n");
printf(" where:\n");
printf("\n");
Expand Down Expand Up @@ -1539,23 +1539,6 @@ void parseCommandLine(int *argc, char *argv[])
}
else if (*argc < 8)
{
if (strstr(argv[0], "-t") == argv[0])
{
if ((strlen(argv[0]) > 2) && (isNumeric(&argv[0][2])))
{
_serverResponseTimeout = atoi(&argv[0][2]);
_serverResponseTimeoutOverride = true;
}
else
{
printf("PSHELL_ERROR: Must provide value for timeout, e.g. -t20\n");
}
for (i = 0; i < (*argc-1); i++)
{
argv[i] = argv[i+1];
}
(*argc)--;
}
if ((_server = getActiveServer(argv[0])) == NULL)
{
if (isNumeric(argv[1]))
Expand Down Expand Up @@ -1596,6 +1579,23 @@ void parseCommandLine(int *argc, char *argv[])
}
(*argc)--;
}
if (strstr(argv[0], "-t") == argv[0])
{
if ((strlen(argv[0]) > 2) && (isNumeric(&argv[0][2])))
{
_serverResponseTimeout = atoi(&argv[0][2]);
_serverResponseTimeoutOverride = true;
}
else
{
printf("PSHELL_ERROR: Must provide value for timeout, e.g. -t20\n");
}
for (i = 0; i < (*argc-1); i++)
{
argv[i] = argv[i+1];
}
(*argc)--;
}
}
else
{
Expand Down

0 comments on commit c64a1fe

Please sign in to comment.