Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Coffelius committed Apr 21, 2022
2 parents 11ac5b2 + e29adff commit 6c80428
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
10 changes: 10 additions & 0 deletions go.mod
@@ -0,0 +1,10 @@
module github.com/Coffelius/rofi-code

go 1.18

require (
github.com/Wing924/shellwords v1.0.1
github.com/akamensky/argparse v1.3.1
)

require github.com/mattn/go-shellwords v1.0.12 // indirect
10 changes: 10 additions & 0 deletions go.sum
@@ -0,0 +1,10 @@
github.com/Wing924/shellwords v1.0.1 h1:GZmk8/8ssKTVqWHXCkq1GslMYUCiUxOSh71BLYnSle0=
github.com/Wing924/shellwords v1.0.1/go.mod h1:i6/AsfK7g4zXotir6nuQAhmyp6kT/FAl3WrbvWVMbYA=
github.com/akamensky/argparse v1.3.1 h1:kP6+OyvR0fuBH6UhbE6yh/nskrDEIQgEA1SUXDPjx4g=
github.com/akamensky/argparse v1.3.1/go.mod h1:S5kwC7IuDcEr5VeXtGPRVZ5o/FdhcMlQz4IZQuw64xA=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk=
github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
5 changes: 2 additions & 3 deletions main.go
Expand Up @@ -15,8 +15,7 @@ import (
"strings"
"syscall"

"./workspace"

"github.com/Coffelius/rofi-code/workspace"
"github.com/Wing924/shellwords"
"github.com/akamensky/argparse"
)
Expand Down Expand Up @@ -278,7 +277,7 @@ func main() {
// Create new parser object
parser := argparse.NewParser("rofi-code", "Use rofi to quickly open a VSCode or Codium workspace")
// Create string flag
s := parser.String("d", "dir", &argparse.Options{Required: false, Help: "Comma separated paths to the config directories", Default: "~/.config/VSCodium,~/.config/Code"})
s := parser.String("d", "dir", &argparse.Options{Required: false, Help: "Comma separated paths to the config directories", Default: "~/.config/VSCodium,~/.config/Code,~/.config/Code\\ -\\ OSS"})
sortOption = parser.Selector("s", "sort", []string{"time", "path", "name"}, &argparse.Options{Required: false, Help: "How the workspaces should be sorted", Default: "time"})
fullpath = parser.Flag("f", "full", &argparse.Options{Required: false, Help: "Show the full path instead of collapsing the home directory to a tilde", Default: false})
var output *bool = parser.Flag("o", "output", &argparse.Options{Required: false, Help: "Just prints the workspaces to stdout and exit", Default: false})
Expand Down
3 changes: 0 additions & 3 deletions workspace/workspace.go
Expand Up @@ -56,12 +56,9 @@ func (workspaces WorkspaceCollection) Sort(sortOption string) {
switch sortOption {
case "name":
sort.Sort(ByName(workspaces))
break
case "path":
sort.Sort(ByPath(workspaces))
break
case "time":
default:
sort.Sort(ByTime(workspaces))
}
}

0 comments on commit 6c80428

Please sign in to comment.