From eb97dc510c92a2fc1a340cccf4103068699947c4 Mon Sep 17 00:00:00 2001 From: "kali kaneko (leap communications)" Date: Tue, 23 Jun 2020 17:12:42 +0200 Subject: [refactor] use qt argument parsing --- pkg/backend/api.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'pkg') 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) +} -- cgit v1.2.3