Skip to content

Commit

Permalink
move subfunctions into functions directory, add text to README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
HackerFoo committed May 3, 2019
1 parent 9ab9ef9 commit ecb04c1
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*~
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
# .go.sh
# .go.sh: a command line shortener

A simple script to automate routine tasks, so you don't have to remember long commands.

Simple, but more flexible and easier to manage than aliases.

# Getting Started

cd ~
git clone https://github.com/HackerFoo/.go.sh.git
source ~/.go.sh/main
5 changes: 5 additions & 0 deletions functions/nixos
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- mode: sh -*-

function __go:switch() {
sudo nixos-rebuild switch
}
File renamed without changes.
16 changes: 10 additions & 6 deletions main
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,19 @@ function __go:commands() {
compgen -A function "__go:" | cut -d: -f 2 | tr '\n' ' '
}


function __go:show() {
declare -f __go:$1
}
function __go:update() {
SRC=`find ${GO_DIR} -type f ! -name '*~' ! -path '*.git*'`
pushd ${GO_DIR}/functions > /dev/null
SRC=`find * -type f ! -name '*~'`
source ${SRC}
stat -c '%n %y' ${SRC}
}
popd > /dev/null

function __go:show() {
declare -f __go:$1
# update completions
complete -W "`__go:commands`" go
}

# update completions
complete -W "`__go:commands`" go
go update > /dev/null

0 comments on commit ecb04c1

Please sign in to comment.