From 06a885ccc33e72ee6b9ffa4df26ebe69432575e0 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Wed, 14 May 2025 11:06:28 -0300 Subject: src/gotext.go: Move Main() to the end of the file --- src/gotext.go | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) (limited to 'src/gotext.go') diff --git a/src/gotext.go b/src/gotext.go index b92d339..993e0f1 100644 --- a/src/gotext.go +++ b/src/gotext.go @@ -409,27 +409,6 @@ func run(env envT) int { return 0 } -func Main() { - // parse args - /* - args, err := flags.ParseArgs(&opts, os.Args) - if err != nil { - log.Fatalf("ParseArgs failed %s", err) - } - */ - - g.Init() - args, rc := getopt(os.Args, os.Stderr) - g.ExitIf(rc) - os.Exit(run(envT{ - args: args, - in: os.Stdin, - out: os.Stdout, - err: os.Stderr, - })) - -} - // SetLocale sets the program's current locale. func SetLocale(category uint, locale string) string { clocale := C.CString(locale) @@ -578,3 +557,17 @@ func Init(name string, localedir string) { BindTextdomain(name, localedir); Textdomain(name) } + + + +func Main() { + g.Init() + args, rc := getopt(os.Args, os.Stderr) + g.ExitIf(rc) + os.Exit(run(envT{ + args: args, + in: os.Stdin, + out: os.Stdout, + err: os.Stderr, + })) +} -- cgit v1.2.3