Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
data_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vojtech Moravec
data_project
Commits
7862809b
Commit
7862809b
authored
6 years ago
by
theazgra
Browse files
Options
Downloads
Patches
Plain Diff
Started CLI parsing.
parent
d50b9749
No related branches found
No related tags found
No related merge requests found
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
czi-format/czi-parser/main.cpp
+39
-2
39 additions, 2 deletions
czi-format/czi-parser/main.cpp
czi-format/czi-parser/utilities/args.hxx
+4173
-0
4173 additions, 0 deletions
czi-format/czi-parser/utilities/args.hxx
with
4212 additions
and
2 deletions
czi-format/czi-parser/main.cpp
+
39
−
2
View file @
7862809b
#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.
Click to expand it.
czi-format/czi-parser/utilities/args.hxx
0 → 100644
+
4173
−
0
View file @
7862809b
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment