summaryrefslogtreecommitdiff
path: root/argv.custom.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-19 02:55:24 -0500
committerJeff Carr <[email protected]>2025-10-19 02:55:24 -0500
commit7b268437f40ffd15fe659b3662d984910a6faefe (patch)
tree109a47aaea9662da01d2d1a9b3f87601855b190d /argv.custom.go
parent618bcf3a36f2229fb819be8164783e945c157a5a (diff)
start converting over to new argv scheme
Diffstat (limited to 'argv.custom.go')
-rw-r--r--argv.custom.go53
1 files changed, 53 insertions, 0 deletions
diff --git a/argv.custom.go b/argv.custom.go
new file mode 100644
index 0000000..9665275
--- /dev/null
+++ b/argv.custom.go
@@ -0,0 +1,53 @@
+// Copyright 2017-2025 WIT.COM Inc. All rights reserved.
+// Use of this source code is governed by the GPL 3.0
+
+package main
+
+import (
+ "os"
+
+ "go.wit.com/lib/protobuf/argvpb"
+)
+
+// sent via -ldflags
+var VERSION string
+var BUILDTIME string
+
+// used for shell auto completion
+var APPNAME string = "startxplacement"
+
+func (a args) Description() string {
+ return `
+startxplacment -- run this after 'startx' to restore all your apps
+
+will attempt to launch your terminal windows on the right Workspaces
+and with the right geometries. TODO: restore the bash working paths
+ `
+}
+
+/*
+ handles shell autocomplete
+*/
+
+func (args) Appname() string {
+ return APPNAME
+}
+
+func (args) Buildtime() (string, string) {
+ return BUILDTIME, VERSION
+}
+
+func (args) Version() string {
+ return argvpb.StandardVersion(APPNAME, VERSION, BUILDTIME)
+}
+
+// sends the strings to bash or zsh that will be your options
+func (a args) SendCompletionStrings(pb *argvpb.Argv) {
+ if pb.Cmd == "" {
+ base := []string{"--restore", "save", "dump", "dumpx", "list", "--version"}
+ pb.SendStrings(base)
+ } else {
+ pb.SubCommand(pb.Goargs...)
+ }
+ os.Exit(0)
+}