Repository navigation
Use the € and § aliases for all parameters #704
Copy link
Copy link
Closed
Labels
Description
This is a breaking change.
Today
€ is an alias for $ and § is an alias for \. They are used for some parameters and not for others:
| Parameter | Aliases used |
|---|---|
| Pattern | Yes |
Replacement (also with --replacement-js) |
Yes |
--exclude-re |
Yes |
| File globs | No |
--exclude-glob |
No |
| Piped data | No |
You must know this list to know what a € or a § does. Each new parameter needs its own rule (see --name-delimiter in #703).
Change
Use the aliases for everything you write on the command line. One rule:
€is$and§is\in all parameters. Use--void-euroor--void-sectionto stop one of them. Use--no-aliasto stop the two of them.
The aliases are never used for piped data or for the content of files. That is data, not something you write on the command line.
New flags
--void-alias: Stop applying the aliases. It is the same as--void-eurotogether with--void-section(short form-§€)--no-alias: The same as--void-alias.
The two flags have no short flags. --void-euro and --void-section stay as they are.
Why
- It is simple to understand and simple to document.
- It can be done one time, before the engine gets the parameters. It is a search and replace on the parameters. Today it is done in three places: for the pattern and for the replacement in
src/engine.ts, and one more time for the replacement insrc/cli.ts(so§nbecomes a line break, see § for line breaks #700). - A new parameter gets the aliases with no extra code.
What breaks
- A file glob or an
--exclude-globwith€or§in it. Today a file with the nameprice€.txtis found with no flags (documented in Documentation is wrong about where€and§are used as aliases #699). After the change the glob becomesprice$.txt. You must use--void-euro, and then the alias is also off for the pattern and the replacement. - A
§in a glob becomes\. In a glob that is the escape character. - The engine no longer knows about the aliases, if they are handled before it. Code that calls the engine directly with
voidEuroorvoidSectiongets no aliases.
To decide
- Does the engine keep
voidEuroandvoidSection, or is this only done by the CLI? - Is there a need to stop the aliases for the globs only? It is not possible today to have a literal
€in a glob and the alias in the pattern in one command. A glob with?in place of the€is a way around it.
Good to know
- The aliases are replaced by
replacePlaceholders()insrc/engine.tsand in thereplacementhandling insrc/cli.ts. -€and-§are the short flags for--void-euroand--void-section. If the aliases are replaced in the raw arguments, these two flags must be read first, or-€becomes-$.- yargs reads
--no-aliasas the negative of a boolean--alias. Analiasoption that is on by default gives--no-aliaswith no extra code. - The JS tests in
test/js/void-euro.test.jsandtest/js/void-section.test.js(and the fuzzy tests with the same names) test the aliases in the engine. They must test the new place. - The README lists where the aliases are used (from Documentation is wrong about where
€and§are used as aliases #699). That text becomes the one rule above.
Reactions are currently unavailable
Activity
mathiasrw commentedon Oct 23, 2026
Solved with one rule, made clear in the help and README in #739: the
€and§aliases are used in everything you write on the command line, except globs, file names and piped data. So a file namedprice€.txtis still found with no flags, and new parameters like the delimiters get the aliases with no extra code.--no-aliaswas not needed, as-§€already does it.