Skip to content

araraloren/perl6-app-snippet

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
bin
 
 
 
 
t
 
 
 
 
 
 
 
 
 
 
 
 

perl-app-snippet

run c/cpp or other language snippet code

Build Status https://ci.appveyor.com/api/projects/status/jxi78155dvv8jrqx?svg=true

Feature

  • Run code from command line arguments

  • Run code input from user

  • compile files and link them to executable binary

  • Preprocess code only

  • Compile code only

  • Code format

TODO

  • Run code grab from web

Usage

  • c

    • code snippet

      $ snippet c -e 'int a = 500;'  -e 'a = rand();' -e 'printf("%d\n", a);' -i stdlib.h -p
      --------------------------------------------------
      #include <stdlib.h>
      #include <stdio.h>
      int main(void)
      {
      int a = 500; a = rand(); printf("%d\n", a);
      return 0;
      }
      --------------------------------------------------
      1804289383
    • read from user

      $ snippet c -r
      Please input your code, make sure your code correct.
      Enter @@CODEEND input.
      int main() {
          printf("Hello World!!\n");
      }
      @@CODEEND
      Hello World!!
    • file

      $ snippet c *.c
      Hello World!!
  • cxx

    • code snippet

      $ snippet cpp -e 'int a{500};' -e 'std::random_device rd{};' -e 'std::uniform_int_distribution<int> dist(0, 100000);' -e 'a = dist(rd);' -e 'std::cout <<a << std::endl;' -p -i random
      --------------------------------------------------
      #include <random>
      #include <iostream>
      int main(void)
      {
      int a{500};
      std::random_device rd{};
      std::uniform_int_distribution<int> dist(0, 100000);
      a = dist(rd);
      std::cout <<a << std::endl;
      return 0;
      }
      --------------------------------------------------
      81873
    • read from user

      $ snippet cpp -r -p
      Please input your code, make sure your code correct.
      Enter @@CODEEND input.
      int main() {
          std::cout <<"Hello World" << std::endl;
      }
      @@CODEEND
      --------------------------------------------------
      #include <iostream>
      int main() {
          std::cout <<"Hello World" << std::endl;
      }
      --------------------------------------------------
      Hello World
    • file

      $ snippet cpp *.cpp
      Hello World!!

Installation

zef install App::snippet

License

GPL

Author

araraloren (blackcatoverwall#gmail.com)

About

run c/cpp or other language snippet code

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Other 100.0%