# \#command-line-options

**URL:** https://discourse.julialang.org/tag/command-line-options/1331.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [How to define subcommands for a \`@main\` command in a Julia app?](https://discourse.julialang.org/t/how-to-define-subcommands-for-a-main-command-in-a-julia-app/134153)

<div class="topic-metadata">

**Author:** [@singularitti](https://discourse.julialang.org/u/singularitti)\
**Replies:** 6\
**Last updated:** [December 2, 2025, 9:35pm UTC](https://discourse.julialang.org/t/how-to-define-subcommands-for-a-main-command-in-a-julia-app/134153 "2025-12-02T21:35:59Z")

</div>

Since Julia now allows us to install an app/command to call it from the Shell by the @main function, I wonder how to mimic cases like some commands having subcommands in @main? Like git add, git status, git clone for git.…

---

## [Standard/common/popular command-line arg parser?](https://discourse.julialang.org/t/standard-common-popular-command-line-arg-parser/133038)

<div class="topic-metadata">

**Author:** [@ryofurue](https://discourse.julialang.org/u/ryofurue)\
**Replies:** 5\
**Last updated:** [October 20, 2025, 10:09am UTC](https://discourse.julialang.org/t/standard-common-popular-command-line-arg-parser/133038 "2025-10-20T10:09:24Z")

</div>

I used ArgMacros.jl for one of my Julia scripts. But it’s been broken with Julia 1.12.0. The initial bug report was 3 weeks ago (for the pre-release version of 1.12.0). I’m not complaining at all. I just wonder whether …

---

## [Introduce a command-line option to warn on constant redefinition?](https://discourse.julialang.org/t/introduce-a-command-line-option-to-warn-on-constant-redefinition/126213)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 6\
**Last updated:** [February 24, 2025, 9:01am UTC](https://discourse.julialang.org/t/introduce-a-command-line-option-to-warn-on-constant-redefinition/126213 "2025-02-24T09:01:36Z")

</div>

Keno’s recent changes on in-development versions of Julia enable safe redefinition of constants, including, for example, struct types. This is great, especially for interactive use, Revise.jl, etc. However, I think it’d…

---

## [ArgMacros: How to use variables as defaults?](https://discourse.julialang.org/t/argmacros-how-to-use-variables-as-defaults/125717)

<div class="topic-metadata">

**Author:** [@ryofurue](https://discourse.julialang.org/u/ryofurue)\
**Replies:** 3\
**Last updated:** [February 12, 2025, 10:34am UTC](https://discourse.julialang.org/t/argmacros-how-to-use-variables-as-defaults/125717 "2025-02-12T10:34:52Z")

</div>

How do you use variables within @tuplearguments of ArgMacros? #!/usr/bin/env julia const usage = "thisscript \[--val1=\<val1\>\] \[--val2=\<val2\>\]" const val2\_default = 9 args = @tuplearguments begin @helpusage Main.usage…

---

## [Error setting mixed type Cmd environment](https://discourse.julialang.org/t/error-setting-mixed-type-cmd-environment/123588)

<div class="topic-metadata">

**Author:** [@KSepetanc](https://discourse.julialang.org/u/KSepetanc)\
**Replies:** 3\
**Last updated:** [December 8, 2024, 3:35pm UTC](https://discourse.julialang.org/t/error-setting-mixed-type-cmd-environment/123588 "2024-12-08T15:35:41Z")

</div>

The following command results in error because it has mixed strings and integers. Cmd(ampl PF.run,env=(“param1”=\>1,“param2”=\>“abc”)) ERROR: MethodError: no method matching byteenv(::Tuple{Pair{String, Int64}, Pair{St…

---

## [Advice on Command Line Usage on HPC with Julia](https://discourse.julialang.org/t/advice-on-command-line-usage-on-hpc-with-julia/108176)

<div class="topic-metadata">

**Author:** [@TI36XPro](https://discourse.julialang.org/u/TI36XPro)\
**Replies:** 6\
**Last updated:** [December 31, 2023, 3:50am UTC](https://discourse.julialang.org/t/advice-on-command-line-usage-on-hpc-with-julia/108176 "2023-12-31T03:50:50Z")

</div>

Hello, I have been working and re-working the method I use to generate and submit runs on my HPC and I’d appreciate any advice or comments on the process (I’m sure there is plenty of room for improvement). Apologies if …

---

## [Define macros depending on optimization level](https://discourse.julialang.org/t/define-macros-depending-on-optimization-level/105714)

<div class="topic-metadata">

**Author:** [@mancolric](https://discourse.julialang.org/u/mancolric)\
**Replies:** 3\
**Last updated:** [November 2, 2023, 7:45pm UTC](https://discourse.julialang.org/t/define-macros-depending-on-optimization-level/105714 "2023-11-02T19:45:45Z")

</div>

I would like to define the macro const var"@lvec" = const var"@turbo @." if Julia is started with optimization levels 2 or 3, and const var"@lvec" = const var"@." otherwise. My main motivation is that I use @tturbo @. v…

---

## [Memory issues using command line argument](https://discourse.julialang.org/t/memory-issues-using-command-line-argument/100590)

<div class="topic-metadata">

**Author:** [@Atasattari](https://discourse.julialang.org/u/Atasattari)\
**Replies:** 4\
**Last updated:** [June 20, 2023, 6:29pm UTC](https://discourse.julialang.org/t/memory-issues-using-command-line-argument/100590 "2023-06-20T18:29:56Z")

</div>

Hi, I’m trying to run a script on a cluster for different input parameters. Instead of submitting scripts with hard-coded values, I’m trying to use command-line arguments. My code works fine when the values are hard-cod…

---

## [How to pass command-line arguments to Jupyter Notebook?](https://discourse.julialang.org/t/how-to-pass-command-line-arguments-to-jupyter-notebook/100148)

<div class="topic-metadata">

**Author:** [@yhchang96](https://discourse.julialang.org/u/yhchang96)\
**Replies:** 1\
**Last updated:** [June 11, 2023, 2:11pm UTC](https://discourse.julialang.org/t/how-to-pass-command-line-arguments-to-jupyter-notebook/100148 "2023-06-11T14:11:30Z")

</div>

How do I pass command line arguments when I run Julia using Jupyter notebook? When I use VS Code to run Julia, I can go to settings and set "julia.additionalArgs": \[ "--heap-size-hint=1G" \], what about J…

---

## [Variable number of command line arguments with ArgParse.jl](https://discourse.julialang.org/t/variable-number-of-command-line-arguments-with-argparse-jl/97493)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 2\
**Last updated:** [April 15, 2023, 2:11pm UTC](https://discourse.julialang.org/t/variable-number-of-command-line-arguments-with-argparse-jl/97493 "2023-04-15T14:11:07Z")

</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”?
