Coder Social home page Coder Social logo

rid-cpp's Introduction

rid cross platform

Joke command for the command line. Prints out sarcastic messages. Think of it as an homage to sl, just with sarcastic quips instead of cool ASCII train animations.

Unlike the original rid which is written in C# for .NET Framework, this is rewritten in C++, so that it can be compiled for basically anything. Changes in program behaviour (i.e., new messages, changed messages, different method of providing messages) will be synced with the .NET original.

Compiled binaries for this version of rid will not be provided -- you are encouraged to compile it yourself. Check the .NET version for Windows binaries of that version.

Building instructions

macOS and Linux

Simply type the following into your terminal:

g++ -o rid main.cpp

Copy the compiled rid program to your usr/local/bin/ directory. (if root then leave sudo out)

sudo cp ./rid /usr/local/bin/

After that, run rid from the terminal.

Non-root instructions

If you lack privileges to write to usr/local/bin/ (i.e. you're not elevated or cannot be elevated) then copy rid to any directory and add that directory to your PATH:

export PATH = /path/to/rid:$PATH
# Replace '/path/to/rid with a path pointing to rid's executable

Windows systems

You need to have MinGW installed and added to your system's PATH. Type the following into your command prompt:

g++ -o .\rid.exe .\main.cpp

Either place rid.exe in C:\Windows\System32 or place it wherever and add it to your system's PATH, then you can run rid straight from the command prompt.

You can skip adding to PATH, but you then have to specify where rid.exe is.

If you intend to use rid on a different PC that does not have MinGW installed, add this to the end of the g++ command:

-static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic

Using Cygwin

Cygwin will work with its own GCC/G++ package, but the rid.exe produced from that will refuse to run on standard Windows and requires Cygwin to run. Cygwin can run both standard Windows and Cygwin-only executables, so it's better to just compile using MinGW.

If you DO decide to compile with Cygwin, follow the macOS and Linux instructions.

Questions and Concerns

  • What'll happen if I compile the code to something else, like main?
    • Then you'd have to type main to run the program.
  • Then why even call it rid?
    • Because that was the original project name, as a play on words for 'dir'.
  • Why not just recompile the .NET version for .NET Core?
    • .NET Core is reliant on having a DLL next to the executable at all times, which may be fine for bigger projects, but not ideal for a small project like this. Besides, I needed to brush up on my C++.

rid-cpp's People

Contributors

that1m8head 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.