Giter VIP home page Giter VIP logo

antiz96 / malias Goto Github PK

View Code? Open in Web Editor NEW
13.0 2.0 2.0 159 KB

An alias manager that allows you to easily add, delete or list your bash aliases in your ".bashrc" file by automating and securing every steps for you.

License: GNU General Public License v3.0

Shell 90.37% Makefile 9.63%
linux bash bash-script bash-scripting bash-scripts alias aliases aliases-setup alias-management bashrc

malias's Introduction

Malias

An alias manager that allows you to easily add, delete or list your bash aliases.

Table of contents

Description

An alias manager that allows you to easily add, delete or list your bash aliases in your ".bashrc" file by automating and securing every steps for you.

Installation

AUR

Arch Linux users can install the malias AUR package.

From Source

Download the archive of the latest stable release and extract it (alternatively, you can clone this repository via git).

To install malias, go into the extracted/cloned directory and run the following command:

sudo make install

To uninstall malias, go into the extracted/cloned directory and run the following command:

sudo make uninstall

Usage

The main menu

Run the malias command to open the main menu that will print every possible operations (add, list, delete, help, quit) followed by a short description.
From there, just type the the operation (or simply the first letter) you want to perform.

The add operation

The add operation allows you to add a new alias.
It will ask for the alias name and the command you want to associate it with.
For instance, in the alias ll='ls -l', ll would be the alias name and ls -l would be the command.
After filling in the requested information and giving the confirmation to proceed, the new alias will automatically be added to your .bashrc file (after being backuped).
Malias will then look for potential errors and apply the new alias or restore the .bashrc's backup (in case there's errors).

The list operation

The list operation prints the list of your current aliases.

The delete operation

The delete operation allows you to delete an alias.
It will print the list of your current aliases with a unique number in front of each aliases (like the list function does).
You must then type the number associated to the alias you want to delete and give the confirmation to proceed.
Once done, the selected alias will automatically be removed from your .bashrc file (after being backuped).
Malias will then look for potential errors and apply the deletion or restore the .bashrc's backup (in case there's errors).

Check the screenshots below for more information.

Screenshot

Run the malias command to open the main menu (also accessible with malias --menu or malias -m).

You can then type add (a for short) to add a new alias, list (l for short) to list your current aliases, delete (d for short) to delete an alias, help (h for short) to display the help or quit (q for short) to quit:

Malias-Menu

Alternatively, you can run the following commands to launch the associated function directly:
malias --add or malias -a to add an alias.
malias --list or malias -l to list your current aliases.
malias --delete or malias -d to delete an alias.
malias --help or malias -h to display the help.

To add an alias, type its name and then the command you want to associate it with.
The new alias can then be used right away.
Each step is automated and secured for you (with backup of your .bashrc file, error checking, backup restore if needed, etc...).
Example below with the alias list='ls -ltr', where list is the alias name and ls -ltr the command:

Malias-Add

The list function is self explanatory, it basically prints your current aliases like so:

Malias-List

To delete an alias, type the number associated to the alias you want to delete.
The deleted alias will then be gone right away.
Once again, each step is automated and secured for you (with backup of your .bashrc file, error checking, backup restore if needed, etc...)
Example below with the 31st alias (list='ls -ltr'), previously added in the "add" function example:

Malias-Delete

Documentation

Options:
  -m, --menu     Print a menu that lists possible operations to choose from (default operation)
  -a, --add      Add a new alias
  -l, --list     List all current aliases
  -d, --delete   Delete an existing alias
  -h, --help     Display this message and exit
  -V, --version  Display version information and exit

Exit Codes:
  0  OK
  1  Invalid option
  2  User didn't gave the confirmation to proceed
  3  An error occurred when creating/restoring the backup of the .bashrc file
  4  An error occurred when adding/removing the alias

For more information, see the malias(1) man page

Contributing

You can raise your issues, feedbacks and suggestions in the issues tab.
Pull requests are welcomed as well!

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.