nat fix bugs
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
(defmethod :Entry createEntry [:Entry->Dynamic initializer] // initializer returns Dynamic so ->:Void isn't required
|
||||
(let [e (_newEntry)]
|
||||
(initializer e)
|
||||
(dictSet entries e.id e)
|
||||
(refreshEntry e)
|
||||
e))
|
||||
|
||||
|
@@ -57,7 +57,7 @@
|
||||
archive
|
||||
continuation))
|
||||
((Entries min max)
|
||||
(unless min (set min 0))
|
||||
(unless min (set min 1))
|
||||
// TODO might want to optimize this O(n) count operation by pre-calculating it
|
||||
(unless max (set max (count archive.entries)))
|
||||
(ui.chooseEntries
|
||||
@@ -69,7 +69,7 @@
|
||||
(< max entries.length))
|
||||
|
||||
(ui.reportError "The requested command expects between $min and $max entries. You chose: $entries.length")
|
||||
(continuation selectedEntries)))
|
||||
(continuation entries)))
|
||||
min
|
||||
max))))
|
||||
|
||||
@@ -116,17 +116,17 @@
|
||||
:Map<String,Command> commands (new Map)]
|
||||
|
||||
(defcommand selectEntry [e OneEntry]
|
||||
(set selectedEntries [e]))
|
||||
(set selectedEntries [e]) [])
|
||||
|
||||
(defcommand selectEntries [entries (Entries null null)]
|
||||
(set selectedEntries entries))
|
||||
(set selectedEntries entries) [])
|
||||
|
||||
(defcommand selectLastChangeSet []
|
||||
(set selectedEntries lastChangeSet))
|
||||
(set selectedEntries lastChangeSet) [])
|
||||
|
||||
(defcommand printSelectedEntries [entries (SelectedEntries null null)]
|
||||
(doFor e entries (ui.displayMessage (archive.fullString e))))
|
||||
(doFor e entries (ui.displayMessage (archive.fullString e))) [])
|
||||
|
||||
(defcommand createEntry [name (Text null null)]
|
||||
(archive.createEntry ->e
|
||||
(addComponent archive e Name name))))
|
||||
[(archive.createEntry ->e
|
||||
(addComponent archive e Name name))]))
|
@@ -4,7 +4,8 @@ import kiss.Prelude;
|
||||
import kiss.List;
|
||||
import kiss.Operand;
|
||||
import sys.FileSystem;
|
||||
import nat.ArchiveController.CommandArgType;
|
||||
import nat.ArchiveController;
|
||||
|
||||
using StringTools;
|
||||
|
||||
@:build(kiss.Kiss.build())
|
||||
|
@@ -12,7 +12,7 @@
|
||||
(.trim (.toString (.readLine (Sys.stdin))))]
|
||||
(if (controller.commands.exists command)
|
||||
(controller.runCommand (dictGet controller.commands command))
|
||||
(Sys.print "$command is not a valid command"))))))
|
||||
(Sys.println "$command is not a valid command"))))))
|
||||
|
||||
(defnew [])
|
||||
|
||||
|
Reference in New Issue
Block a user