summaryrefslogtreecommitdiff
path: root/src/MtsIoSysfs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/MtsIoSysfs.cpp')
-rw-r--r--src/MtsIoSysfs.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/MtsIoSysfs.cpp b/src/MtsIoSysfs.cpp
index ab68c8c..20e2925 100644
--- a/src/MtsIoSysfs.cpp
+++ b/src/MtsIoSysfs.cpp
@@ -44,10 +44,9 @@ static enum action_code action;
int main(int argc, char **argv) {
Device m;
+ m.setProgramName(argv[0]);
action = ACTION_NONE;
- if (argc < 2) {
- m.printUsage(argv[0]);
- }
+
std::string fpgaFilePath = "";
std::string forcedAP = "";
std::string name = "";
@@ -55,6 +54,10 @@ int main(int argc, char **argv) {
int duration = 0;
MTS::Logger::setPrintLevel(MTS::Logger::PrintLevel::INFO_LEVEL, true);
+ m.setHWVersion();
+ if (argc < 2) {
+ m.printUsage();
+ }
int c;
static struct option long_options[] = {
{"help", no_argument, nullptr, 'h'},
@@ -148,11 +151,11 @@ int main(int argc, char **argv) {
exit(-1);
}
case 'h': {
- m.printUsage(argv[0]);
+ m.printUsage();
exit(0);
}
default:
- m.printUsage(argv[0]);
+ m.printUsage();
exit(-1);
}
}
@@ -213,7 +216,7 @@ int main(int argc, char **argv) {
switch (action) {
case ACTION_NONE: {
- m.printUsage(argv[0]);
+ m.printUsage();
}
case ACTION_SHOW: {
m.show(name);
@@ -251,7 +254,7 @@ int main(int argc, char **argv) {
case ACTION_VERSION: {
m.printVersion(argv[0]);
}
- default: { m.printUsage(argv[0]); }
+ default: { m.printUsage(); }
}
return 0;