Read up on the background section of Python's optparse module, it answers some of your questions and exemplifies with some common argument formatting standards seen in the wild. The optparse module author recommends a style that roughly corresponds to the POSIX conventions for command line arguments, with the addition of --double-dashed-long-arguments which comes from the GNU coding standard.

Answer from Gaslight Deceive Subvert on Stack Overflow
🌐
Sde-coursepack
sde-coursepack.github.io › modules › java › Command-Line-Arguments
SDE | Command Line Arguments
As a general convention, the short form has one hyphen, and the long form has two hyphens. Note that you can also have optional arguments with parameters. For example, let’s say instead of -j, I have -c which lets the user specify any one of several calendars (including the Julian), but I still default to Gregorian because it is the most widely used calendar in the world today. At that point, I may have a command lined like: java edu.virginia.cs.commandline.IsLeapYear 1900 -c Julian
Discussions

java - Are there any standard Command line conventions for dashes and arguments? - Stack Overflow
What are the command-line conventions regarding when to use 2 dashes, 1 dash, or simply no options at all and simply read inputs in order? I realize there are many variants, but do any conventions... More on stackoverflow.com
🌐 stackoverflow.com
Java Command line arguments - Stack Overflow
I am trying to detect whether the 'a' was entered as the first string argument. More on stackoverflow.com
🌐 stackoverflow.com
parameters - What is the hyphen used for in shell script argument parsing? - Stack Overflow
Why do we use a hyphen for l but not for myDir? ... See: Arguments, options and dashes. ... BTW, the "dash" StackOverflow tag is for questions about a specific shell named dash, not for the dash character. ... Also, this doesn't actually have anything at all to do with shells. ls -l is a UNIX command, not a shell command -- you can run it from a program written in Java ... More on stackoverflow.com
🌐 stackoverflow.com
command line - Single dashes `-` for single-character options, but double dashes `--` for words? - Unix & Linux Stack Exchange
Where did the convention of using single dashes for letters and doubles dashes for words come from and why is continued to be used? For example if I type in ls --help, you see: -a, --all ... More on unix.stackexchange.com
🌐 unix.stackexchange.com
October 1, 2011
🌐
ThoughtCo
thoughtco.com › using-command-line-arguments-2034196
Using Command-Line Arguments in a Java Application
January 20, 2019 - The argument informing the application what the argument is for typically has a hyphen or two before its name. For example, the NetBeans example for the startup parameter specifying the JDK path is · This means you'll need to parse the command-line ...
🌐
Oracle
docs.oracle.com › javase › tutorial › essential › environment › cmdLineArgs.html
Command-Line Arguments (The Java™ Tutorials > Essential Java Classes > The Platform Environment)
This is because the space character separates command-line arguments. To have Drink, Hot, and Java interpreted as a single argument, the user would join them by enclosing them within quotation marks.
Find elsewhere
🌐
TechOverflow
techoverflow.net › 2022 › 12 › 08 › command-line-when-to-use-single-hyphen-or-double-hyphen
Command line: When to use "-" (single hyphen) or "--" (double hyphen) | TechOverflow
December 8, 2022 - Examples where double hyphens can be used:--verbose, --server and --help, but you can’t use them for single-letter arguments like --h or --R ... # Show the help message for a command using the -h short form argument my_command -h # Enable verbose output for a command using the --verbose long form argument my_command --verbose # Combine multiple arguments my_command --verbose --server https://techoverflow.net -f 0.1
🌐
GeeksforGeeks
geeksforgeeks.org › java › command-line-arguments-in-java
Command Line Arguments in Java - GeeksforGeeks
Command-line arguments are passed after the class name while running the Java program. ... The JVM collects these values and passes them to the main(String[] args) method. ... Example: In this example, we are going to print a simple argument in the command line. ... class GFG{ public static void main(String[] args) { // Printing the first argument System.out.println(args[0]); } }
Published   May 28, 2026
🌐
Florida State University
cs.fsu.edu › ~jtbauer › cis3931 › tutorial › essential › attributes › cmdLineArgs.html
Command-Line Arguments
This is because the space character separates command-line arguments. If you want Drink, Hot, and Java to be interpreted as a single argument, you would join them by enclosing them within double quotation marks.
🌐
Stack Overflow
stackoverflow.com › questions › 49662152 › parsing-named-cli-arguments-to-java-with-a-double-dash
command line interface - Parsing named cli arguments to java with a double dash - Stack Overflow
April 5, 2018 - I need to pass parameters to a java application with a double dash, like this: java -cp "app.jar" package.App --parameter1=arg1 --parameter2=arg2 What is the easiest way to do this in Java? Thank...
🌐
University of Pennsylvania
cis.upenn.edu › ~bcpierce › courses › 629 › papers › Java-tutorial › java › cmdLineArgs › cmdLineArgs.html
Command-Line Arguments
This is because the space character separates command-line arguments. If you want Drink Hot Java to be interpreted as a single argument, you would join them with double quotes, which the system consumes.
🌐
Medium
medium.com › @AlexanderObregon › processing-command-line-arguments-in-java-applications-200ba9b7f029
Processing Command-Line Arguments in Java Applications
March 14, 2025 - Java does not automatically validate arguments, so the program must handle them explicitly. Since command-line arguments are space-separated, special handling is required if an argument contains spaces. Consider the following command: ... Quotation marks are used to group words into a single argument. Without them, the JVM would interpret hello and world as two separate arguments.
🌐
DEV Community
dev.to › mohamad_mhana › java-program-with-command-line-arguments-5bb7
Java Program with Command-Line Arguments - DEV Community
September 29, 2025 - java Main 5 0 4 args[0] = "5" // array size args[1] = "0" // initial value args[2] = "4" // increment · Length check: args.length tells you how many arguments were passed. Behind the scenes: JVM creates the array and calls Main.main(args) automatically. ... All command-line arguments are Strings, even numbers.
🌐
Deep Java
digibeatrix.com › home › java fundamentals › java command-line arguments and string[] args explained
Java Command-Line Arguments and String[] args Explained - Deep Java
3 weeks ago - Command-line parsing starts in the shell before Java receives anything. That means quoting and escaping rules can differ between PowerShell, Command Prompt, bash, zsh, and CI runners. In many shells, double quotes keep a spaced value together as one argument: ... If a command behaves differently in Windows PowerShell, Command Prompt, Git Bash, macOS Terminal, or a CI system, print the received arguments with a small diagnostic program.
🌐
TechVidvan
techvidvan.com › tutorials › java-command-line-arguments
Java Command Line Arguments with Examples - TechVidvan
April 9, 2020 - What is java command line arguments? Learn with easy examples and programs. Learn points to remember while using command line arguments to avoid errors.