summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2020-06-23 17:12:42 +0200
committerkali kaneko (leap communications) <kali@leap.se>2020-08-11 20:59:50 +0200
commiteb97dc510c92a2fc1a340cccf4103068699947c4 (patch)
treed9bc5ade18bb47d618ee4411183b99086e7a9f6f /pkg
parentcf5ed56c943599c092a91933b45471c4c0e5d579 (diff)
[refactor] use qt argument parsing
Diffstat (limited to 'pkg')
-rw-r--r--pkg/backend/api.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/pkg/backend/api.go b/pkg/backend/api.go
index fea38db..64dac9d 100644
--- a/pkg/backend/api.go
+++ b/pkg/backend/api.go
@@ -9,6 +9,7 @@ import (
"unsafe"
"0xacab.org/leap/bitmask-vpn/pkg/bitmask"
+ "0xacab.org/leap/bitmask-vpn/pkg/config/version"
"0xacab.org/leap/bitmask-vpn/pkg/pickle"
)
@@ -74,3 +75,17 @@ func EnableMockBackend() {
log.Println("[+] Mocking ui interaction on port 8080. \nTry 'curl localhost:8080/{on|off|failed}' to toggle status.")
go enableMockBackend()
}
+
+/* these two are a bit redundant since we already add them to ctx. however, we
+ want to have them available before everything else, to be able to parse cli
+ arguments. In the long run, we probably want to move all vendoring to qt, so
+ this probably should not live in the backend. */
+
+func GetVersion() *C.char {
+ return C.CString(version.VERSION)
+}
+
+func GetAppName() *C.char {
+ p := bitmask.GetConfiguredProvider()
+ return C.CString(p.AppName)
+}