Open ArchLeaders opened 1 year ago
nx-editor.exe <action> <input_file> [-f|--flags] FLAGS
Actions can be defined in the ReactiveEditor
impl via a common interface (ICommandModel
) and/or in a global action process for file-type agonistic actions (e.g. De/CompressZs
).
e.g.
public class SarcViewModel : ReactiveEditor, ICommandModel
{
// . . .
public Task ICommandModel.ProcessAction(string actionName, Dictionary<char, string> flags)
{
// Could also be automatically
// processed with reflection
return actionName switch {
"Extract" => ExtractFile(flags['k']),
_ => throw new Exception($"Action {actionName} was not found")
};
}
// . . .
}
The source (input) file used to identify the ReactiveEditor
and consequently operate actions on.
An infinite array of [-x|--xx] XXX
type flag arrangements specific to each ReactiveEditor/Action.
e.g. for SarcViewModel
[-k|--key] KEY
--key "Some/Sarc/Path"
Given the modularity and verbosity of the rest of this system, it would follow that the docs could also be auto-generated from the current state of editors/actions.
This might prove difficult with the current proposal, so further discussion should follow once we have a clearer implementation spec.
A CLI-safe abstraction of the ReactiveEditor
may be a good idea to avoid complications with UI code while still maintaining the same organization of parsers.
This might be possible by just casting to an interface level (ICommandModel
) and moving some implementations around (mainly the ctor) to give the required access to the interface.
This issue is stale because it has been open for 30 days with no activity.
General discussion and proposals for the CLI (command line interface) implementation.