Commit Graph

14 Commits

Author SHA1 Message Date
Etan Kissling cb858a27f4
Fix `cli` invocation from nimscript (#109)
* Fix `cli` invocation from nimscript

When calling `cli` macro from nimscript, there are compilation issues:

- `nim-faststreams` is not available, therefore, `nim-serialization`
  does not work, due to `equalMem` being gated behind `notJSnotNims`.
  Dropping support for config files in nimscript contexts fixes that.

- `std/strformat` raises `ValueError` for invalid format strings, but
  does so at runtime rather than checking types at compiletime. As it
  is only used for simple string concatenation in error cases, changing
  to simple concatenation avoids verbose error handling.

- `getAppFilename()` is unavailable in `nimscript`. This was already
  fixed by replacing it with `appInvocation()` but two instances of
  direct `getAppFilename()` calls remained in default arguments.
  This is fixed by changing those default arguments as well.

- The `!= nil` check on the `proc` in `loadImpl` does not work when
  called from nimscript. This is fixed by changing to `isNil`.

- Passing `addr result` around to internal templates correctly creates
  the config, but the object ultimately being returned is not the same.
  Passing `var result` directly through the templates ensures that the
  correct `result` gets modified and is clearer than implicit capture.

Applying these fixes fixes running `.nims` files with `cli` macro.

* Add debugging output on failure

* Update confutils.nimble

* Update confutils.nim
2024-10-30 10:49:34 +00:00
Miran cb640db2cd
update ci.yml and be more explicit in .nimble (#104) 2024-07-01 18:06:47 +02:00
jangko 7340359702
Add copyright to source code 2024-02-12 10:26:05 +07:00
tersec 1f3acaf6e9
remove support for Nim v1.2 and v1.4 (#75) 2023-05-31 15:37:01 +00:00
tersec 273aa6cc3f
test both refc and ORC in post-1.6 Nim versions (#73) 2023-04-13 23:35:19 +00:00
Luke 56f4db90f7
Update confutils.nimble (#57)
Co-authored-by: Jacek Sieka <jacek@status.im>
2022-11-23 19:30:59 +01:00
Jacek Sieka 269c17401d
update CI, normalise nimble (#61) 2022-11-23 17:30:29 +01:00
Kim De Mey 05a438414a
Enable --styleCheck:usages (#41) 2022-02-24 21:43:04 +01:00
Ștefan Talpalaru 0435e67832
CI: test with multiple Nim versions (#38)
* CI: test with multiple Nim versions
2022-01-04 17:21:15 +01:00
jangko 0cd09d75c8 add compile time check to detect duplicate abbr and duplicate name 2021-09-08 15:53:44 +03:00
jangko 4981d719a1
setup ci 2020-10-20 15:35:47 +07:00
Zahary Karadjov d5bcca04da
Fix a test using obsolete pragmas 2020-03-24 17:31:05 +02:00
Jacek Sieka 9224d1feaf
std_shims -> stew 2019-07-07 11:41:15 +02:00
Zahary Karadjov d2e4e02c3b initial version 2018-11-21 15:26:48 +02:00