More incremental progress.

This commit is contained in:
Ben 2025-07-27 17:06:28 -07:00
parent ab3b46713f
commit ed4bbeb608
Signed by: webmaster
GPG key ID: A5FCBAF34E6E8B50
4 changed files with 107 additions and 6 deletions

View file

@ -3,13 +3,21 @@ package args
/* This file manages declaration of, parsing of, and returning copies of
command line arguments. */
import "flag"
import (
"flag"
"os"
)
/* Method to trigger flag parsing. Can be called multiple times safely. */
func Parse() {
if (flagsParsed) {return}
flag.Parse();
flagsParsed = true;
// Process DBUS socket location
if socketLocation == nil || *socketLocation == "" {
*socketLocation = os.Getenv("DBUS_SYSTEM_BUS_ADDRESS");
}
}
/* module-specific variable to avoid re-parsing flags */
var flagsParsed bool = false;
@ -39,7 +47,7 @@ func GetSocketLocation() (port string, set bool) {
}
/* Where the signal-cli binary is */
var binaryLocation = flag.String("binary", "", "Location of the signal-cli binary.")
var binaryLocation = flag.String("binary", "/usr/local/bin/signal-cli", "Location of the signal-cli binary.")
/* @return set boolean will be true if argument is not nil */
func GetBinaryLocation() (port string, set bool) {
if binaryLocation == nil {return "", false}