alcover / lacy

compile/run for the lazy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

logo

lacy - Compile/run for the lazy

(Linux only)

Want to test a few lines of C ?

Normally you'd have to :

  • create test.c
  • write headers #include <stdfoo.h> #include <stdbar.h>...
  • write entry-point int main (int argc ...) {}
  • write your code
  • save
  • finally run gcc test.c -Wall -Wbar && ./a.out

Forgot a header ? To link math (-lm) ?
Bad luck... Now you have to edit test.c...

No such hassle with lacy :

$ lacy  
int i = pow(2,8);  
printf ("%d\n", i);  
[CTRL+D]  
256

lacy can also run files.
$ lacy hello.c

If your code has no main(), lacy adds classic headers and puts your statements into main().

Usage

File :

$ lacy hello.c  
Hello!

File + arguments :

$ lacy hello.c Bob    
Hello Bob!

Pipe :

$ cat hello.c | lacy  
Hello!

Prompt :

$ lacy  
printf ("%s\n", "Hello!");  
[CTRL+D]  
Hello!

Inline :

$ lacy 'printf ("%s\n", "Hello!");'  
Hello!

Print template :

$ lacy > new_project.c (gets you a fresh all-included source)

Options

$ lacy -h (help)
$ lacy -v (version)

About

compile/run for the lazy

License:MIT License


Languages

Language:Shell 96.4%Language:C 3.6%