forked from Rodrig79/Project-3-A-Simple-Network-File-System
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient.cpp
More file actions
30 lines (25 loc) · 650 Bytes
/
client.cpp
File metadata and controls
30 lines (25 loc) · 650 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// CPSC 3500: main
// Executes the file system program by starting the shell.
#include <iostream>
#include <cstring>
using namespace std;
#include "Shell.h"
int main(int argc, char **argv)
{
Shell shell;
if (argc == 2) {
shell.mountNFS(string(argv[1]));
shell.run();
}
else if (argc == 4 && strcmp(argv[1], "-s") == 0) {
shell.mountNFS(string(argv[3]));
shell.run_script(argv[2]);
}
else {
cerr << "Invalid command line" << endl;
cerr << "Usage (one of the following): " << endl;
cerr << "./nfsclient server:port" << endl;
cerr << "./nfsclient -s <script-name> server:port" << endl;
}
return 0;
}