`basename` parses the command line in two stages
1. **options** – any argument that starts with `-` (or a `--` that stops
option processing);
2. **operands** – the file names that come after the options.
So
```bash
basename -s .md -
```
is read as
```
options : -s .md
operand : '-'
```
The single `-` is just the name of the file that is passed to the
program; it is not treated as an option because it follows the last option
(`-s`).
When the file name itself begins with a dash, the parser would normally
think it is another option. The convention for “end‑of‑options” is the
double dash `--`. Everything that follows `--` is taken as a non‑option
argument, even if it starts with a dash.
```bash
basename -s .md -- '-'
```
or
```bash
basename -s .md \-
```
Both commands tell `basename` to treat the next token (`-`) as the file
name, not as an option. The `--` itself is **not** an operand; it is only a
sentinel. If it is the last thing on the command line, `basename` prints
```
basename: missing operand
```
because no file name follows it. That is the reason you saw the error
when you replaced the single `-` with `--` – the file name after `--`
was missing or empty.