-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaliasrc
52 lines (47 loc) · 956 Bytes
/
aliasrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Aliases
alias ls="exa"
alias ll="exa -alh"
alias tree="exa --tree"
alias ripgrep="rg"
GS_function (){
param1=$1
param2=$2
echo "I am doing the function"
echo "First parameter: $param1"
echo "Second parameter: $param2"
}
git_clone_function() {
user=""
repo=""
# If nothing is passed
if [[ $# -lt 4 ]]; then
echo "Usage: GS -u <user> -p <profile>"
fi
# Parse the variables to their place
while [[ $# -gt 0 ]]; do
echo "hola"
case $1 in
-u|--user)
user=$2
shift 2
;;
-r|--repo)
repo=$2
shift 2
;;
*)
echo "No -u|--user and -r|--repo arguments passed, function exiting with 1."
set --
;;
esac
done
# If the parameters are specified do the operation
if [[ -n $user || -n $repo ]]; then
echo "User: $user"
echo "Repo: $repo"
echo "Cloning [email protected]:$user/$repo.git"
git clone "[email protected]:$user/$repo.git"
fi
}
alias GS='GS_function'
alias gsshclone='git_clone_function'