petermr / ami3

Integration of cephis and normami code into a single base. Tests will be slimmed down
Apache License 2.0
17 stars 5 forks source link

short commands in `picocli` not working when concatenated #44

Closed petermr closed 4 years ago

petermr commented 4 years ago

small options (-s, -d, -m) work when explicit but ...

pm286macbook:ami-jars2 pm286$ ami -p more-papers --inputname raw -v pdfbox filter -s -d -m image --posterize 16

Generic values (AMIPDFTool)
================================
not found: cProject must be existing directory or have directory parent: more-papers (/Users/pm286/workspace/cmdev/ami-jars2/more-papers
************************
WARNING: CProject directory does not exist
************************

input basename      raw
input basename list null
cproject            
ctree               
cTreeList           null
excludeBase         null
excludeTrees        null
forceMake           false
includeBase         null
includeTrees        null
log4j               
verbose             1

Specific values (AMIPDFTool)
================================
maxpages            5
svgDirectoryName    svg/
minimagesize        (10,10)
outputSVG           true
pdf2html            false
imgDirectoryName    pdfimages/
outputPDFImages     true
parserDebug         AMI_BRIEF
no trees

Generic values (AMIFilterTool)
================================
input basename      raw
input basename list null
cproject            
ctree               
cTreeList           null
excludeBase         null
excludeTrees        null
forceMake           false
includeBase         null
includeTrees        null
log4j               
verbose             1

Specific values (AMIFilterTool)
================================
--duplicate         : m duplicate
--maxheight         : d      1000
--maxwidth          : d      1000
--minheight         : d       100
--minwidth          : d       100
--monochrome        : m monochrome
--small             : m     small
--help              : d     false
--version           : d     false
no trees

Generic values (AMIImageTool)
================================
input basename      raw
input basename list null
cproject            
ctree               
cTreeList           null
excludeBase         null
excludeTrees        null
forceMake           false
includeBase         null
includeTrees        null
log4j               
verbose             1

Specific values (AMIImageTool)
================================
--borders           : d      null
--filter            : d     false
--minheight         : d       100
--minwidth          : d       100
--binarize          : d      null
--despeckle         : d     false
--erodedilate       : d     false
--maxheight         : d      1000
--maxwidth          : d      1000
--posterize         : m        16
--priority          : d       RAW
--rotate            : d      null
--scalefactor       : d      null
--sharpen           : d      none
--template          : d      null
--thinning          : d      null
--threshold         : d      null
--toolkit           : d      null
--help              : d     false
--version           : d     false

no trees

... but fails when concatenated

pm286macbook:ami-jars2 pm286$ ami -p more-papers --inputname raw -v pdfbox filter -sdm image --posterize 16
Invalid value for option '--small': expected one of [_delete, small] (case-sensitive) but was 'dm'
Usage: ami filter [OPTIONS]
Try 'ami filter --help' for more information.
pm286macbook:ami-jars2 pm286$ 
remkop commented 4 years ago

Clustered Options

Short options (also known as POSIX options) can be clustered, if they are boolean options that do not accept an argument. Only the last option in a cluster can take an argument.

Example:

tar -xvfFILE

Is equivalent to tar -x -v -f=FILE.

These options can be clustered because -x and -v are flags that don't take an argument.

How does this apply to filter options

The POSIX short options -s, -d and -m in the filter command do take an argument, so they cannot be clustered.

The -s option can accept an argument, so picocli interprets -sdm image as -s=dm image.