GithubHelp home page GithubHelp logo

cl-calc's Introduction

CL Calc

Crates.io MIT licensed Build Status

CL Calc is command line calculator that I made as a side project to learn to make a interpreter. It is messy and inefficient but is a fun proof of concept.

To install you can either:

  1. Build from source
  2. Install with cargo using cargo install cl-calc

Running the program with no arguments allows you to enter commands line by line similar to how node works. Run with a path as the first argument to run the commands in that file. (I use .calc but is doesn't matter).

The valid options are:

  1. --help which can also be accessed with -? and -h
    This will explain all the ways the program can be run. (equivalent to this list)
  2. --version which can also be accessed with -v
    This will print the programs version.
  3. --about
    This gives some basic information about this program.

There command that you can use while typing into the command line to they are prefixed with a ! and are.

  1. !exit
    This will exit the program.
  2. !help
    This will give you additional information on how to use this program
  3. !vars
    This will print out all of the names of the user defined functions and constants.
  4. !file <path> This will execute all of the commands in a file
  5. !out <path> This will output all successfully run commands to a file

The ! commands do not work in a file.

When running a file you can put a ! at the start of the line to have it output as well. Only the last line will be put into ans. This works when running a file as an argument and in the cli.

cl-calc's People

Contributors

thedrjosh avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.