2023-05-20 20:15:57 +02:00
|
|
|
// Copyright 2023 wanderer <a_mirre at utb dot cz>
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2023-05-04 21:28:30 +02:00
|
|
|
package settings
|
|
|
|
|
|
|
|
import "flag"
|
|
|
|
|
|
|
|
// as per https://stackoverflow.com/a/54747682.
|
|
|
|
func isFlagPassed(name string) bool {
|
|
|
|
found := false
|
|
|
|
|
|
|
|
flag.Visit(func(f *flag.Flag) {
|
|
|
|
if f.Name == name {
|
|
|
|
found = true
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
return found
|
|
|
|
}
|