add interactive tables for all commands
This commit is contained in:
parent
c72b82f542
commit
00cee25075
7 changed files with 563 additions and 117 deletions
21
internal/dirs/dirs.go
Normal file
21
internal/dirs/dirs.go
Normal 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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue