Hello. I would like to share some exciting ideas about "meta-commands" with the group.
Here is a list of considered meta-commands:
- do - performs an action.
- undo - undoes an action when possible.
- can do - returns whether a system can presently do an action with the provided arguments, without doing it.
- can undo - returns whether a system can presently undo an action with the provided arguments, having done it, without undoing it.
- could undo - returns whether a system would be able to undo an action if it were to do it, without doing it.
The following examples illustrate intended usage:
> undo cmd arg1 arg2
> can cmd arg1 arg2"Undo" would be a powerful and convenient tool to have for use with many other executables.
"Can" would be a useful tool for easily validating command-line arguments or, for some executables, performing more complex pre-flight checklists.
As considered, programs would be self-contained with respect to their functionalities for doing and undoing actions, for indicating whether they could do or could undo actions, and for indicating whether actions could be undone. That is, in addition to main() functions, programs could, optionally, provide functions like undo_main(), can_main(), can_undo_main(), and could_undo_main().
With respect to implementing meta-commands, ideas include there being multiple entry points in ELF executables or there, otherwise, being multiple ways to load and execute them.
Are multiple entry points in ELF executables a way to go? This would, I think, require updating the ELF standard. Do any other techniques come to mind?