Skip to content

stavshamir/bag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bag - Bash Alias Generator

This tool suggests aliases based on non-aliased frequently used commands, and provides a painless way to apply them.

Build

  1. Run:
$ ./gradlew fatJar
  1. Create a home directory for the application
  2. Into the home directory, copy the files install.sh, build/libs/bag-1.0-SNAPSHOT.jar and build/resources/main/alias.sh
  3. From the home directory, run:
$ source install.sh

-OR- Download from here and install:

  1. Unzip
  2. From the unzipped directory, run:
$ source install.sh

Usage:

bag [-c <index> [-a <alternative alias name>]]
 -a,--alternative <alias name>   create an alias with an alternative name
 -c,--create <index>             create an alias with the suggested name
 -h,--help                       print usage
 -l,--print-all                  print a list of all suggested aliases
 -p                              print a list of suggested aliases

The new aliases become available after restarting the shell.

Examples:

  1. Printing a list of suggested aliases
$ bag -p
SUGGESTED	COMMAND		TIMES USED
(1) fab		foo -a -b -c	42
(2) bde		bar -d -e -f	5
  1. Creating a suggested alias
$ bag -c 1
New alias was created: alias fab='foo -a -b -c'
  1. Creating a suggested alias with an alternative name
$ bag -c 2 -a bam
New alias was created: alias bam='bar -d -e -f'

Releases

No releases published

Packages

No packages published