From 3948bfeac6c0efd9117dfe9643f8fdcdb66076ac Mon Sep 17 00:00:00 2001 From: Mario Fink Date: Thu, 11 Feb 2021 19:54:09 +0100 Subject: [PATCH] fix/improve printing and CLI --- lib/imc_channel.hpp | 9 +++++---- lib/imc_raw.hpp | 6 ++++-- src/main.cpp | 10 +++++++--- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/lib/imc_channel.hpp b/lib/imc_channel.hpp index 578957d..77450ec 100644 --- a/lib/imc_channel.hpp +++ b/lib/imc_channel.hpp @@ -375,9 +375,9 @@ namespace imc if ( sep == ' ' ) { fou<first + std::string(".csv"); + std::string chid = std::string("channel_") + it->first; + std::string filenam = it->second.name_.empty() ? chid + std::string(".csv") + : it->second.name_ + std::string(".csv"); std::filesystem::path pf = pd / filenam; // and print the channel diff --git a/src/main.cpp b/src/main.cpp index e54bd58..660ff1a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -119,7 +119,7 @@ void show_usage() // <<" -g, --listgroups list channelgroups\n" <<" -c, --listchannels list channels\n" <<" -b, --listblocks list IMC key-blocks\n" - <<" -d, --output output directory\n" + <<" -d, --output output directory to print channels\n" <<" -h, --help show this help message \n" <<" -v, --version display version\n" <<"\n"; @@ -198,9 +198,13 @@ int main(int argc, char* argv[]) } // print channel(s) to certain directory - if ( cfgopts.count("directory") == 1 ) + if ( cfgopts.count("output") == 1 ) { - std::cout<