Skip to content

Commit

Permalink
add get command
Browse files Browse the repository at this point in the history
  • Loading branch information
akymos committed Aug 13, 2022
1 parent e1dcc90 commit b5e9cb8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ func main() {
p, err := os.Getwd()
if err != nil {
fmt.Println(err)
os.Exit(1)
}
arg2 = p
}
Expand All @@ -91,6 +92,14 @@ func main() {
fmt.Printf("Alias: %s -> Folder: %s\n", k, v)
}
os.Exit(0)
case "get", "g":
p, err := localDb.get(arg1)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
fmt.Printf("%s", *p)
os.Exit(0)
case "alias":
err = populateAlias()
if err != nil {
Expand All @@ -109,13 +118,15 @@ Available Commands:
delete, del, d, - Remove an alias.
update, upd, u Update an alias.
list, ls, l List all aliases.
get, g Return the raw path of an alias, useful, for example, with ls.
alias Prints out the path to the alias file.
Examples:
ff add current_folder_alias
ff + alias_name /path/to/folder
ff update alias_name /path/to/new/folder
ff ls
ls -lha "$(ff g alias_name)"
ff del alias_name
Version: %s
Expand Down

0 comments on commit b5e9cb8

Please sign in to comment.