Skip to content

Commit

Permalink
Merge remote-tracking branch 'benma/macosargs'
Browse files Browse the repository at this point in the history
  • Loading branch information
benma committed Feb 17, 2020
2 parents 1c74f06 + 557fb36 commit b22ca46
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions frontends/qt/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,15 @@ import "C"

import (
"flag"
"os"
"runtime"
"strings"
"unsafe"

"github.com/digitalbitbox/bitbox-wallet-app/backend/bridgecommon"
btctypes "github.com/digitalbitbox/bitbox-wallet-app/backend/coins/btc/types"
"github.com/digitalbitbox/bitbox-wallet-app/backend/devices/usb"
"github.com/digitalbitbox/bitbox-wallet-app/util/logging"
"github.com/digitalbitbox/bitbox-wallet-app/util/system"
)

Expand Down Expand Up @@ -76,11 +80,24 @@ func serve(
responseCallback C.responseCallback,
notifyUserCallback C.notifyUserCallback,
) {
log := logging.Get().WithGroup("server")
log.WithField("args", os.Args).Info("Started Qt application")
// workaround: this flag is parsed by qtwebengine, but flag.Parse() quits the app on
// unrecognized flags
// _ = flag.Int("remote-debugging-port", 0, "")
testnet := flag.Bool("testnet", false, "activate testnets")

if runtime.GOOS == "darwin" {
// eat "-psn_xxxx" on Mac, which is passed when starting an app from Finder for the first time.
// See also: https://stackoverflow.com/questions/10242115/os-x-strange-psn-command-line-parameter-when-launched-from-finder
for _, arg := range os.Args[1:] {
trimmed := strings.TrimLeft(arg, "-")
if strings.HasPrefix(trimmed, "psn_") {
flag.Bool(trimmed, false, "<ignored>")
}
}
}

gapLimitsReceive := flag.Uint("gapLimitReceive", 0, "gap limit for receive addresses. Do not use this unless you know what this means.")
gapLimitsChange := flag.Uint("gapLimitChange", 0, "gap limit for change addresses. Do not use this unless you know what this means.")

Expand Down

0 comments on commit b22ca46

Please sign in to comment.