12 releases

0.1.15 Nov 15, 2024
0.1.14 Oct 17, 2024
0.1.11 Aug 24, 2024
0.1.8 Jun 2, 2024
0.1.7 Nov 19, 2023

#224 in Build Utils

Download history 152/week @ 2024-08-19 15/week @ 2024-08-26 12/week @ 2024-09-16 129/week @ 2024-09-30 28/week @ 2024-10-07 146/week @ 2024-10-14 9/week @ 2024-10-21 1/week @ 2024-10-28 101/week @ 2024-11-11 19/week @ 2024-11-18 14/week @ 2024-12-02

134 downloads per month

MIT license

27KB
590 lines

sticks Logo

sticks

Sticks is a Rust command-line tool for managing C and C++ projects. It simplifies the process of creating new projects and managing dependencies in your Makefile.

Features

  • Create new C and C++ projects with a single command.
  • Generate a basic project structure with source files and a Makefile.
  • Automatically set up "Hello, World!" code in the chosen language.
  • Easily add and remove dependencies in your Makefile.

Before proceeding with the quick install, please make sure you have Rust installed. If you don't have Rust installed, you can download and install it from the official Rust website.

Quick Install

curl -fsSL https://rebrand.ly/tyzot1g | bash

OR

cargo install sticks

Quick Uninstall

sudo apt remove sticks -y

OR

cargo uninstall sticks

Build from Source

To use sticks, you'll need to build the project:

  1. Clone the repository:

    git clone https://github.com/mAmineChniti/sticks.git
    
  2. Change the current directory to the project folder:

    cd sticks
    
  3. Build the project using cargo:

    cargo build --release
    
  4. Once the build is complete, you can find the binary in the target/release directory. You can add this directory to your system's PATH for convenient usage.

Usage

Creating a New Project

To create a new C project, use the following command:

sticks c <project_name>

To create a new C++ project, use the following command:

sticks cpp <project_name>

Replace <project_name> with the name of your project.

These commands will create a new project directory with the specified name, set up a source file, and create a basic Makefile. The source file will contain a "Hello, World!" program in C++ or C.

Initializing a Project in the Current Directory

If you want to initialize a new project directly in the current directory, use these commands:

To initialize a new C project in the current directory, use:

sticks init c

To initialize a new C++ project in the current directory, use:

sticks init cpp

These commands will create a new project based on the current directory name, set up a source file, and create a basic Makefile. The source file will contain a "Hello, World!" program in C++ or C, depending on the chosen project type.

Adding a Dependency

To add a dependency to your project's Makefile, use the following command:

sticks add <dependency_name>

Replace <dependency_name> with the name of the dependency you want to add. Sticks will automatically modify your Makefile to include the new dependency. If the install-deps rule doesn't exist in your Makefile, Sticks will create it for you.

Adding source files

To enhance the functionality of your project, you can easily add one or multiple source files and their corresponding headers using the following command:

sticks src <source_names>

Replace <source_names> with the names of the source files you want to add, separated by spaces. Sticks will intelligently update your project structure, including the necessary modifications to your Makefile.

List Subcommands

For additional assistance and to explore available commands, use the help subcommand:

sticks help

Updating Sticks

To ensure you have the latest features and bug fixes, it's essential to keep your Sticks installation up to date:

sticks update

To-Do List

  • Implement the removal of dependencies by using the sticks remove <dependency_name> command.
  • Remove the install-deps rule when there are no more dependencies left to install.
  • Modularize the code, put the smaller functions into a commonly used mod, keep only the functions that correspond to subcommands in main.
  • Add the ability to add multiple dependencies using sticks add.
  • Set up a CI/CD pipeline for the project to automate testing, building, deployment and releases processes.

Contributing

If you'd like to contribute to Sticks or report issues We welcome contributions and feedback from the community, all you have to is open an issue or fork this repo to contribute.

Fore more details visit CONTRIBUTING

License

This project is licensed under the MIT License. See the LICENSE file for details.

For any inquiries, feel free to email us at emin.chniti@esprit.tn.

Dependencies

~1.5MB
~25K SLoC