-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
68 lines (47 loc) · 1.15 KB
/
Copy pathmain.cpp
File metadata and controls
68 lines (47 loc) · 1.15 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#include <iostream>
#include "MiniGit.h"
using namespace std;
void showMenu() {
cout << "\n========== MINI GIT ==========\n";
cout << "1. Initialize Repository\n";
cout << "2. Status\n";
cout << "3. Commit\n";
cout << "4. Show Commit History\n";
cout << "5. Exit\n";
cout << "==============================\n";
cout << "Enter choice: ";
}
int main() {
int choice;
string path;
string message;
while (true) {
showMenu();
cin >> choice;
cin.ignore();
switch (choice) {
case 1:
cout << "Enter repository folder path: ";
getline(cin, path);
initializeRepo(path);
break;
case 2:
showStatus();
break;
case 3:
cout << "Enter commit message: ";
getline(cin, message);
createCommit(message);
break;
case 4:
showCommitHistory();
break;
case 5:
cout << "Exiting MiniGit...\n";
return 0;
default:
cout << "Invalid choice.\n";
}
}
return 0;
}