/ALX_Time_Saver

Time is money, save it with ALX Time Saver.

Primary LanguageShellGNU General Public License v3.0GPL-3.0

ALX Time Saver LOGO

Welcome to "ALX Time Saver" ⏰

Tired of those endless "git add," "git commit," and "git push" commands? Frustrated with typing out lengthy compilation strings? Say goodbye to the tedium and whitespace woes with ALX Time Saver!

⚠️ IMPORTANT NOTE: At ALX, we prioritize learning. Make sure you grasp these operations manually before diving into the convenience of ALX Time Saver. We're here to help you grow! ⚠️

If you love our project, show some love with a star and, if you're feeling adventurous, contribute to make it even better.

To contribute: Fork the project, make changes with proper documentation, ensure they work, and submit a pull request.

🙏 Contributions can vary from fixing typos and issues to adding exciting new features. 🙏

Key Features

  1. Comfortable:

  2. Custom Vim Configuration:

  3. Readme Maker

    • Automatically Organizes Project Files in an Interactive Table
  4. All-in-One Toolkit

    • Extracts all function prototypes for a project and appends them to the header file.
    • Generates project files with ease.
    • Retrieves test files (x-main.c).
    • Downloads _putchar.c and updates header file with its prototype.
  5. Test Suite

    • Develop a test suite capable of efficiently examining multiple test cases with simplicity and speed.

Changelogs

Added

* ALX Time Saver v2.11 (31-10-2023)
* F1 for pycodestyle in vim
* mkfiles :
   1 . support for python files, chmod a+x, shebang included.
   2 . Integrated README Maker
   3 . New pattern for header name detection
* compile :
   1 . Compile in debugging mode by default
   2 . -o flag for output
* push :
   -m flag for commit message

Changed

-

Fixed

- mkfiles:
   1 . Fixed wrong header name

Known Issues

1 . push :
   * git check-ignore command might be unstable (need to do more testing to confirm this)
2. F3 does not fully support python

To Do

* Updater script
* Add autoindent for python
* Fix known issues
* Add support for python test files in mkfiles

Installation in 3 Simple Steps 😃

  1. Clone the repository:

    git clone https://github.com/Matsadura/ALX_Time_Saver/
    
  2. Navigate to the cloned directory:

    cd ALX_Time_Saver
    
  3. Run the installation script:

    ./install.sh
    

Let it work its magic, and you're all set! 🚀

If you want to unistall :

./unistall.sh

NOTE: If you've used the previous version, please restart your system to avoid conflicts with this version.

Features

Push Command

Run the push command, select the file(s) to push, and add your commit message.

push

Syntax Description
push Interactive mode
push -f Force-add ignored files in interactive mode
push file_name1 file_name_2... One-line command
push -f file_name1 file_name2... Force-push one-line command
the above plus '-m' "commit msg Add a commit message

Compile Command

Run the compile command, select the test file (if it exists) and the code to compile. Avoid typing all the flags every time!

compile

Syntax Description
compile Interactive mode
compile file_1 file_2... One-line command
the above plus '-o' Add the output's name

mkscript Command

Run the mkscript command, type your script's name, and it will automatically open in Vim with #!/bin/bash or #!/usr/bin/python3 already written at the top. After exiting, the file will have executable permission.

mkscript

Syntax Description
mkscript Interactive mode
mkscript file_name Semi-interactive mode
mkscript -p Semi-interactive mode for Python script
mkscript -b Semi-interactive mode for Bash script
mkscript -p file_name One-line command for Python script
mkscript file_name -p One-line command for Python script
mkscript -b file_name One-line command for Bash script
mkscript file_name -b One-line command for Bash script

fixall command

Run fixall command followed the the specified directory(s), it'll automatically fix the indentation and remove all white spaces from the .c and .h files.

fixall demo

Syntax Description
fixall Automatically selects the current directory
fixall dir1 dir2 ... Selects the specified directories

Vim Configs

vim config

The numbers are handy for jumping between lines without counting them.

Compiling with F5

To compile the current file by pressing F5, the file must be in this format: "number"-"name".c (e.g., 0-putchar.c), and there should be a test file usually named "number"-main.c (e.g., 0-main.c). If the test file doesn't exist, use the compile command instead.

VIM F5 Showcase

Betty with F2

Press F2 in Vim instead of leaving it to run "betty file_name.c" separately.

Betty

Auto Indent with F3

Check out this demonstration. PS : It does not work on python (yet)

Vim Auto Indent

Remove Whitespace with F4

Whitespace is highlighted in red.

TrailierTrash

Readme Maker

To use this script, first configure it by replacing the info as shown:

readme_config

CD to ALX-Time-Saver and launch the script with ./read_maker.py. Enter the repo name, project's subdirectory, and make sure everything you need is pushed to GitHub. The script generates markdown for your README.md.

readmaker_demo

Clicking on a file opens it (on GitHub).

All-in-One Maker

Run the script with mkfiles, and the new files will be in your chosen location.

Demonstration:

mkfiles

Test Suite

Execute the setall command in the sequence of the main function file, followed by the header file and the test cases. Afterward, use the testall command, specifying the main function files and the additional function files to initiate the test suite. Points to Remember:

  • It's unnecessary to employ the setall command again when reusing the test suite.
  • To update the test cases, reset the test suite, maintaining the same order of arguments to ensure the corresponding tests are updated.
  • The main function should always be the first argument in the testall command; otherwise, it won't function correctly.
  • The additional fucntion files are required during compilation.
  • You can have multiple test suites.

test suite demo

Syntax Description
setall main_function.c header.h test1.c testX.c ... Sets the test suite for the main_function.c
testall main_function.c secondary_function.c more_functions.c ... Runs the test suite for the main_function.c

Enjoy coding efficiently with ALX Time Saver! 🕒💻

This project is made with love, special thanks to all the contributors.