Skip to content

Commit ae41d42

Browse files
committedApr 28, 2022
add_help
1 parent 998b03f commit ae41d42

File tree

3 files changed

+14
-33
lines changed

3 files changed

+14
-33
lines changed
 

‎src/Client.cpp

+13
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,17 @@ namespace qml {
149149
}
150150
delete socket_file;
151151
}
152+
void Client::printHelp() {
153+
if (com[0] == "send") {
154+
std::cout << "send -[] filename" << std::endl;
155+
std::cout << "usage:" << std::endl;
156+
std::cout << " -al 算数编码" << std::endl;
157+
std::cout << " -ar 自适应算数编码" << std::endl;
158+
std::cout << " -lz lz算法" << std::endl;
159+
std::cout << " -rl rle编码" << std::endl;
160+
std::cout << " -hf 哈夫曼编码" << std::endl;
161+
}
162+
}
152163
void Client::handle() {
153164
bzero(cmd ,sizeof cmd);
154165
std::cout << "->";
@@ -166,6 +177,8 @@ namespace qml {
166177
break;
167178
} else if (com[0] == "cls") {
168179
system("clear");
180+
} else if (com[1] == "?") {
181+
printHelp();
169182
} else {
170183
SendCom();
171184
}

‎src/Client.h

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ namespace qml{
2222
void SendFile();
2323
void Send_txt(Encode* en);
2424
void SendCom();
25+
void printHelp();
2526

2627
private:
2728
Socket* socket_com;

‎tmp.txt

-33
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.