aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2020-07-04 09:55:57 +0000
committers-ol <s-ol@users.noreply.github.com>2020-07-04 09:55:57 +0000
commit5bc3e6036365bdb2acc85ee8d6ba6ab97c8d1572 (patch)
treea61c3d422edfebabce27dbf2c40b99809e55e1c8
parentexplicit sort in Makefile (diff)
downloadalive-5bc3e6036365bdb2acc85ee8d6ba6ab97c8d1572.tar.gz
alive-5bc3e6036365bdb2acc85ee8d6ba6ab97c8d1572.zip
copilot: pass args through base constructor
-rw-r--r--alv/copilot/base.moon4
-rw-r--r--alv/copilot/cli.moon3
-rw-r--r--alv/copilot/fltk.moon4
-rw-r--r--alv/copilot/wx.moon3
4 files changed, 5 insertions, 9 deletions
diff --git a/alv/copilot/base.moon b/alv/copilot/base.moon
index 5d752a6..f7dc00a 100644
--- a/alv/copilot/base.moon
+++ b/alv/copilot/base.moon
@@ -34,11 +34,11 @@ class Copilot
--- create a new Copilot.
-- @classmethod
-- @tparam string file name/path of the alive file to watch and execute
- new: (file) =>
+ new: (@args) =>
@T = 0
@last_modification = 0
@last_modules = {}
- @open file if file
+ @open @args[1] if @args[1]
--- members
-- @section members
diff --git a/alv/copilot/cli.moon b/alv/copilot/cli.moon
index 3686491..ada6f31 100644
--- a/alv/copilot/cli.moon
+++ b/alv/copilot/cli.moon
@@ -15,9 +15,8 @@ class ColorLogger extends Logger
class CLICopilot extends Copilot
new: (arg) =>
- @args = parse_args arg, { nocolor: false }
+ super parse_args arg, { nocolor: false }
assert @args[1], "no filename given"
- super @args[1]
run: =>
if @args.nocolor
diff --git a/alv/copilot/fltk.moon b/alv/copilot/fltk.moon
index a370613..7664f0c 100644
--- a/alv/copilot/fltk.moon
+++ b/alv/copilot/fltk.moon
@@ -24,8 +24,6 @@ class FLTKLogger extends Logger
class FLTKCopilot extends Copilot
new: (arg) =>
- @args = parse_args arg
-
@window = with fl.Window { 400, 240, "alv copilot", xclass: 'alv' }
\size_range 400, 220, nil, nil, 20, 20
@@ -67,7 +65,7 @@ class FLTKCopilot extends Copilot
tile\end_group!
@window\end_group!
- super @args[1]
+ super parse_args arg
about: =>
fl.alert "alive #{version.tag} fltkCopilot.
diff --git a/alv/copilot/wx.moon b/alv/copilot/wx.moon
index b740794..9e2ad93 100644
--- a/alv/copilot/wx.moon
+++ b/alv/copilot/wx.moon
@@ -28,8 +28,7 @@ class WXLogger extends Logger
class WXCopilot extends Copilot
new: (arg) =>
- @args = parse_args arg
- super @args[1]
+ super parse_args arg
@app = wx.wxGetApp!
@app.VendorName = 'alive'