No description
  • C++ 96.5%
  • CMake 3.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2025-10-06 14:37:24 +05:30
.gitignore goto v0.0.1 2025-09-10 18:54:44 +05:30
CMakeLists.txt v0.0.0.0 change to look for libraries in current executable path :| 2025-10-06 14:37:24 +05:30
main.cpp minor bug fixes 2025-09-15 01:21:33 +05:30
README.md readme changes 2025-09-15 01:23:42 +05:30

Simple Goto script written in cpp.

Usage:

goto [OPTION|LINK_NAME]

Options:

-h  --help        : Show this info
-c  --create_link : Create a new link e.g: goto --create_link [LINK_NAME] [FROM_PATH]
-l  --list        : List all the existing links
-lo --links-only  : List the name of the links only (This is mostly for autocompletion).
-p  --print-path  : Prints the path of the specified link and exits. e.g: goto -p [LINK_NAME]
-d  --delete-link : Delete an exisiting link e.g: goto -d [LINK_NAME]
-rf --delete-file : Delete the existing link file completely.
[LINK_NAME]       : Goes to an exisiting link e.g: goto [LINK_NAME]
 last             : Stores the last navigated link directory
 prev             : Stores the directory from which last navigation was performed

To use add a function in shell like:

Bash

function goto() {
	if [[ "$#" -eq 1 ]] && [[ "$1" != -* ]]; then
		out=$(/home/ud/Scripts/goto $1 2>&1)
		if [[ "$?" -eq "0" ]]; then
			cd "$out"
		else
			echo $out
		fi
	else
		/home/ud/Scripts/goto $@
	fi	
}

Fish

function goto
    if test (count $argv) -eq 1
        if not string match -rq -- '^-' "$argv[1]"
            set out (/home/ud/Scripts/goto $argv[1] 2>&1 )
            if test $status -eq 0
                cd "$out"
            else
                echo $out
            end
        else
            /home/ud/Scripts/goto $argv
        end
    else
        /home/ud/Scripts/goto $argv
    end
end