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

Cannot put mandatory argument after optional ones? #27

Open
blaiseli opened this issue Aug 12, 2019 · 0 comments
Open

Cannot put mandatory argument after optional ones? #27

blaiseli opened this issue Aug 12, 2019 · 0 comments

Comments

@blaiseli
Copy link

Consider the following usage description:

Usage:
  qaf_demux.jl [-i <input_fastq> | --input_fastq <input_fastq>] (-o <output_dir> | --output_dir <output_dir>) -b <barcode> -s <barcode_start> [-m <max_diff>]

-h --help                                 Show this help message and exit.
-i --input_fastq <input_fastq>            Fastq file to demultiplex. Default is to read from stdin.
-o --output_dir <output_dir>              Directory in which to put demultiplexed fastq files.
-b --barcode <barcode>                    Barcodes to which the reads should be attributed.
-s --barcode_start <barcode_start>        Position at which the barcode starts (1-based).
-m --max_diff <max_diff>                  Only assign a record to one of the barcodes if it has no more than *max_diff* differences in its barcode portion. [default: 3]

My script is complaining if I specify the mandatory option -o after the optional argument -m on my command-line:

ERROR: LoadError: ArgumentError: invalid base 10 digit '/' in "/tmp/test_qaf_demux"

If I put the -o earlier, it is fine.

(The script is also complaining if I do not provide option -m, because it doesn't populate the args with the desired default value "-m"=>false,"<max_diff>"=>nothing, but I should probably report this as a separate issue.)

@blaiseli blaiseli changed the title Argument order mandatory Cannot put mandatory argument after optional ones? Aug 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant