Q:

Create Own Module I Can Use On Terminal

I'm working on a mac terminal and I'm creating some simple commands that I can run anywhere. These are mostly to do things I repeatedly do in one simple command, so I don't have to type it out every time. Some examples:
alias changetocertaindestination="cd ~/repos/certaindestination"
opencertainfile() {
open ~/repos/mydestination/certainfile.txt
}

I would like to know how to make it so I can use the notation that other modules/packages(I'm not sure what they are called) use, i.e. git branch , instead of gitbranch
So instead of every prefacing every alias with changeto, and using changetodestination I can use changeto destination. 

A:

You just need to parameterize your functions.
changeto () {
  cd -- ~/repos/"$1"
}

$ changeto certaindestination
$ pwd
/home/alex/repos/certaindestination

