diff options
| author | s-ol <s-ol@users.noreply.github.com> | 2020-07-04 09:55:57 +0000 |
|---|---|---|
| committer | s-ol <s+removethis@s-ol.nu> | 2025-03-02 14:24:49 +0000 |
| commit | 035c7ecc32fea2667afced9a6f94c9c8c42264e2 (patch) | |
| tree | 25e3f1996fb82af2579ed124342cceef2ed78e3e | |
| parent | explicit sort in Makefile (diff) | |
| download | alive-035c7ecc32fea2667afced9a6f94c9c8c42264e2.tar.gz alive-035c7ecc32fea2667afced9a6f94c9c8c42264e2.zip | |
copilot: pass args through base constructor
| -rw-r--r-- | alv/copilot/base.moon | 4 | ||||
| -rw-r--r-- | alv/copilot/cli.moon | 3 | ||||
| -rw-r--r-- | alv/copilot/fltk.moon | 4 | ||||
| -rw-r--r-- | alv/copilot/wx.moon | 3 |
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' |
