aboutsummaryrefslogtreecommitdiff
path: root/oop2eindopdr/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'oop2eindopdr/main.cpp')
-rw-r--r--oop2eindopdr/main.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/oop2eindopdr/main.cpp b/oop2eindopdr/main.cpp
new file mode 100644
index 0000000..5eb8beb
--- /dev/null
+++ b/oop2eindopdr/main.cpp
@@ -0,0 +1,34 @@
+#include <cstdlib>
+#include <iostream>
+
+using std::endl;
+using std::cout;
+
+int interactive_mode() {
+ std::string gert;
+ bool user_exit = false;
+ while (!user_exit) {
+ cout << "interactive mode" << endl;
+ std::cin >> gert;
+ }
+ return EXIT_SUCCESS;
+}
+
+int export_mode(int argc, char** argv) {
+ cout << "export mode! let's convert " << std::string(argv[1]) << " to " << std::string(argv[2]) << endl;
+
+ return EXIT_SUCCESS;
+}
+
+int main(int argc, char** argv) {
+ if (argc == 1) { // no arguments specified
+ return interactive_mode();
+ } else if (argc == 2 || argc == 3) {
+ return export_mode(argc, argv);
+ } else { // three or more arguments
+ cout << "too many arguments specified!" << endl;
+ return EXIT_FAILURE;
+ }
+
+ return EXIT_SUCCESS;
+}