Open Commons ObservatoryEnglish·Русский

Every program is told what to do in two ways when it starts: by the words typed after its name, and by settings left waiting for it in its environment. Almost no program writes down what it accepts in either.

A typo that says nothing

Misspell an option and you may get an error. Misspell an environment setting and you get silence - always. No warning, no failure: only a program quietly doing the wrong thing, found out days later.

Ask which settings a program really accepts, and the honest answer is: read its source code. The table in its documentation was typed by hand, and it drifted the day somebody forgot to update it.

One declaration, two doors

With argenv a program declares each of its inputs once: its name, its kind, the values it allows, its default, what it is for. That one declaration is what the program itself reads - so it cannot drift from the truth.

And an option on the command line and a setting in the environment stop being two things. They are one setting with two doors, so they share a kind, a default and a description.

A socket with a label

A wall socket says what it gives: this voltage, this shape of plug. You do not find out by plugging something in and watching what burns.

Written down, so it can be checked

Because the list is published as a plain document, a tool can check any way of starting the program against it before the program runs - and say: this setting is not known; did you mean that one?

That works for a program written in any language, even one that never used argenv, as long as somebody wrote its list down.

What it does not cover

It covers what the operating system hands a program at its start - not configuration files, which mostly have their own descriptions already. And a contract helps only where someone publishes it.

Where it stands

Published as a Rust library, and used by a real tool. Two questions of its design are still open.