# Variable number of command line arguments with ArgParse.jl

**URL:** <https://discourse.julialang.org/t/variable-number-of-command-line-arguments-with-argparse-jl/97493>\
**Category:** General Usage\
**Tags:** command-line-options\
**Created:** [April 14, 2023, 9:23pm UTC](https://discourse.julialang.org/t/variable-number-of-command-line-arguments-with-argparse-jl/97493 "2023-04-14T21:23:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![greatpet](https://avatars.discourse-cdn.com/v4/letter/g/e495f1/32.png) [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Post date:** [April 14, 2023, 9:23pm UTC](https://discourse.julialang.org/t/variable-number-of-command-line-arguments-with-argparse-jl/97493/1 "2023-04-14T21:23:14Z")

</div>

With ArgParse.jl, how can I parse key word arguments like `--myoption 1` while ignoring all positional arguments, when the number of position argument is not fixed, i.e. “vararg”?

---

<div class="post-metadata">

**Author:** ![greatpet](https://avatars.discourse-cdn.com/v4/letter/g/e495f1/32.png) [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Post date:** [April 15, 2023, 12:01pm UTC](https://discourse.julialang.org/t/variable-number-of-command-line-arguments-with-argparse-jl/97493/2 "2023-04-15T12:01:02Z")

</div>

Simpler question: does ArgParse.jl (or a similar package) have support for variable numbers of cmd arguments?

---

<div class="post-metadata">

**Author:** ![fatteneder](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fatteneder/32/33991_2.png) [@fatteneder](https://discourse.julialang.org/u/fatteneder)\
**Post date:** [April 15, 2023, 2:11pm UTC](https://discourse.julialang.org/t/variable-number-of-command-line-arguments-with-argparse-jl/97493/3 "2023-04-15T14:11:07Z")

</div>

I would be surprised if `ArgParse.jl` would not support this (but I never used it either …)

Anyways, did you have a look at their documentation?  
In particular this section here speaks about the `nargs` options: [Argument table · ArgParse.jl](https://carlobaldassi.github.io/ArgParse.jl/stable/arg_table/#Available-actions-and-nargs-values)
