Skip to content
Snippets Groups Projects
Commit 7862809b authored by theazgra's avatar theazgra
Browse files

Started CLI parsing.

parent d50b9749
Branches
No related tags found
No related merge requests found
#include "czi_parser.h"
#include "file_system.h"
#include "compression/rle.h"
#include "utilities/args.hxx"
int main(int argc, char **argv)
{
args::ArgumentParser argParser("CZI file tools", "Optional arguments are in [ ] necessary in < >.");
args::Group cziFileGroup(argParser, "CZI file input - necessary.", args::Group::Validators::All);
args::Group mainMethodGroup(argParser, "Main method - what to do with parsed file", args::Group::Validators::AtMostOne);
args::Group parserOptionsGroup(argParser, "CZI parser options", args::Group::Validators::DontCare);
args::Group optionsGroup(argParser, "Program options", args::Group::Validators::DontCare);
args::ValueFlag<std::string> cziFile(cziFileGroup, "czi file", "CZI file to load.", {'i', "input"});
args::HelpFlag helpMethod(mainMethodGroup, "help", "Print help", {'h', "help"});
args::Flag reportMethod(mainMethodGroup, "report", "Basic information about CZI file. [verbose]", {"report"});
args::Flag dontParseMetadataOption(parserOptionsGroup, "no metadata", "Dont read metadata byte", {"no-metadata"});
args::Flag verboseOption(optionsGroup, "verbose", "Extend output of method", {'v', "verbose"});
try
{
argParser.ParseCLI(argc, argv);
}
catch (args::Help)
{
std::cout << argParser;
return 0;
}
catch (args::ValidationError e)
{
std::cout << e.what() << std::endl;
std::cout << argParser;
return 1;
}
catch (args::ParseError pe)
{
std::cout << pe.what() << std::endl;
std::cout << argParser;
return 1;
}
/*
std::string cziFile = (argc > 1) ? argv[1] : "/home/mor0146/gitlab/data_project/czi-format/data/CZT-Stack-Anno.czi"; //"/home/mor0146/gitlab/data_project/czi-format/data/m2/exampleSingleChannel.czi";
if (cziFile == "-v" || cziFile == "--version")
{
......@@ -57,6 +94,6 @@ int main(int argc, char **argv)
}
printf("Finished.\n");
*/
return 0;
}
\ No newline at end of file
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment