Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SHDESIGNOptions false positive #159

Closed
furmanc opened this issue Oct 2, 2018 · 1 comment · Fixed by #190 or #191
Closed

SHDESIGNOptions false positive #159

furmanc opened this issue Oct 2, 2018 · 1 comment · Fixed by #190 or #191

Comments

@furmanc
Copy link
Contributor

furmanc commented Oct 2, 2018

Expected behavior

By using the example of SH.DESIGN.Options in RNC CNES we should expect no error

Actual behavior

By using the example of SH.DESIGN.Options in RNC CNES we have an error SH.DESIGN.Options

In SH.DESIGN.Options LEX we have the following conditions to raise the SH.DESIGN.Options error:
if (!getopts || !getoptExtern || !help || !version || !helpLong || !versionLong)

but actually we think these conditions should be :
if ( (getopts && (!help || !version)) || (getoptExtern && (!helpLong || !versionLong)) )

Steps to reproduce behavior

Detection version

V3.0.1

@begarco begarco added this to the Version 4.0.0 milestone Jan 7, 2020
@furmanc
Copy link
Contributor Author

furmanc commented Jan 13, 2020

pls check the correction with example below

    optspec="vr:,d:,p:,h,-:"
    while getopts "${optspec}" OPTION 
    do 
        case "${OPTION}" in 
            h ) input_to_process=0;
                usage ;; 
            v ) input_to_process=0;
                echo "ql_s2 V1.6 using OTB 6.6" ;; 
            r ) res=${OPTARG};;
            p ) product_name=${OPTARG};;
            d ) destination_root_directory=${OPTARG};;
            - )  LONG_OPTARG="${OPTARG#*=}";
                case ${OPTARG} in
                    help ) input_to_process=0;
                        usage;;
                    version ) input_to_process=0;
                        echo "ql_s2 V1.6 using OTB 6.6";;
                    sd=?* ) destination_sub_directory=${LONG_OPTARG};;
                    sd* ) echo "No arg for --${OPTARG} option" >&2; 
                         exit 1;;
                    rgb | irgb | comp ) quicklook_type=${OPTARG};;
                    rgb* | irgb* | comp* )
                        echo "No arg allowed for --${OPTARG} option" >&2; 
                        exit 1;;
                    '') break ;; # "--" terminates argument processing
                    *)  echo "No arg allowed for --${OPTARG} option" >&2; 
                        exit 1;;
                 esac;;
            \? ) echo "Invalid option: -${OPTARG}" >&2;
                exit 1;;
            : ) echo "Option -${OPTARG} requires an argument." >&2
                exit 1;;
         esac
    done

This was referenced Feb 9, 2020
@begarco begarco mentioned this issue Feb 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants