WIP CLI
This commit is contained in:
@@ -3,21 +3,26 @@ package nat;
|
||||
import kiss.Prelude;
|
||||
import kiss.List;
|
||||
import kiss.Operand;
|
||||
|
||||
import haxe.Constraints;
|
||||
|
||||
enum CommandArgument {
|
||||
enum CommandArgType {
|
||||
SelectedEntry;
|
||||
SelectedEntries(min:Null<Int>, max:Null<Int>);
|
||||
Text(minLength:Null<Int>, maxLength:Null<Int>);
|
||||
Text(minLength:Null<Int>, maxLength:Null<Float>); // max length is a float so Math.POSITIVE_INFINITY can be used
|
||||
Number(min:Null<Float>, max:Null<Float>, inStepsOf:Null<Float>);
|
||||
Entry;
|
||||
OneEntry; // This constructor must be disambiguated from the typedef "Entry"
|
||||
Entries(min:Null<Int>, max:Null<Int>);
|
||||
}
|
||||
|
||||
typedef CommandArg = {
|
||||
name:String,
|
||||
type:CommandArgType
|
||||
};
|
||||
|
||||
typedef Command = {
|
||||
args:Array<CommandArgument>,
|
||||
args:Array<CommandArg>,
|
||||
handler:Function
|
||||
// Command handlers need to return a ChangeSet
|
||||
};
|
||||
|
||||
typedef ChangeSet = Array<Entry>;
|
||||
|
||||
Reference in New Issue
Block a user