add interactive tables for all commands

This commit is contained in:
Lilian Jónsdóttir 2024-06-19 15:55:01 -07:00
parent c72b82f542
commit 00cee25075
7 changed files with 563 additions and 117 deletions

21
internal/dirs/dirs.go Normal file
View file

@ -0,0 +1,21 @@
package dirs
import (
"os"
"path/filepath"
"strings"
)
// UnExpand unexpands some directory shortcuts
//
// $HOME -> ~
func UnExpand(dir string) (outdir string) {
var (
home = os.Getenv("HOME")
)
outdir = filepath.Clean(dir)
outdir = strings.ReplaceAll(outdir, home, "~")
return
}