kapsis icon indicating copy to clipboard operation
kapsis copied to clipboard

trying to compile any commands creates an error and doesnt work

Open meykbelieve opened this issue 1 year ago • 2 comments

i tried to compile the example in the readme

import
  kapsis

commands:
  -- "Source-to-Source"
  src string(-s), path(`timl`), bool(--pretty):
    ## Transpile `timl` code to a specific target source
  
  ast path(`timl`), filename(`output`):
    ## Generate binary AST from a `timl` file

but it creates this error when i try to compile it Screenshot from 2025-01-06 at 10_18_20 014830641

meykbelieve avatar Jan 06 '25 16:01 meykbelieve

First, generate your package using nimble init as binary app.

In mypackage.nimble add requires "kapsis#head"

A working example should be:

import pkg/kapsis
import pkg/kapsis/cli

proc oneCommand*(v: Values) =
  displayInfo("Hello")

proc twoCommand*(v: Values) =
  displayWarning("yay!")

commands:
  -- "Source-to-Source"
  one string(-s), path(`timl`), bool(--pretty):
    ## A cool description here
  
  two path(`timl`), filename(`output`):
    ## Something smart about this command

Build your program using nimble build instead of nim

georgelemon avatar Jan 06 '25 17:01 georgelemon

that gives the exact same error when running the nimble build command. in a different project I tried to use the pkgver nimble package, but that gave the same error when compiling. i dont have a problem when using nimble packages from any other organizations, so thats odd.

meykbelieve avatar Jan 11 '25 02:01 meykbelieve