-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Many of the your scripts contain a lot useful stuff. But much of it is packed together in a way that makes it hard to re-arrange their composition from the commandline.
One of Demlo's strength is specifically to trigger which "component" to execute at runtime.
A simple -s foo or -r bar is enough. When several features are within one scripts, that's much harder.
With that, it's also possible to have "metascripts" that enable a set of scripts.
Take the following example:
$ cat 10-foo.lua
if inhibit_foo then return end
-- Rest of the code here.
-- Do only one thing.
$ cat 11-bar.lua
if inhibit_bar then return end
-- ...
$ cat 12...
...
$ cat 10--meta_all.lua
inhibit_foo=nil
inhibit_bar=nil
...
$ cat 10--meta_none.lua
inhibit_foo=true
inhibit_bar=true
...
$ cat 10--meta_foo_and_some_other_scripts.lua
inhibit_foo=nil
inhibit_bar=true
...
$ cat demlorc
Scripts = {'10-foo', '11-bar', ...}
Then the user can simply select the right metascript with all the normal scripts on and it will do the right thing.
This is similar to what you've done with the globals script, except that it is easier to tweak from commandline: auto-completion can list both the scripts and the metascripts. No need for extra variables nor extra documentation. No need for cumbersome -pre scripts either.
What do you think?