diff options
| author | Jeff Carr <[email protected]> | 2025-10-12 10:59:12 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-12 10:59:12 -0500 |
| commit | 4f6d12faae49559d9740799fff771bf56bf9e881 (patch) | |
| tree | a10e7d631541844ed20405a9356d234ed1d13215 | |
| parent | 894260660b7218c023db8ba27bba478bcfffe7c1 (diff) | |
wow, total fuckup. never do this.
| -rw-r--r-- | theMagicOfAutocomplete.go | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/theMagicOfAutocomplete.go b/theMagicOfAutocomplete.go index e1ad4d5..34ba8f7 100644 --- a/theMagicOfAutocomplete.go +++ b/theMagicOfAutocomplete.go @@ -30,6 +30,14 @@ func Autocomplete(dest any) *Auto { arg.Register(&argBash) arg.Register(&argGui) + // user is trying to setup bash or zsh autocomplete + // --bash or --zsh is the first os.Args + if pb.SetupAuto { + // --bash was passed. try to configure bash-completion + MakeAutocompleteFiles(myAuto.appName) + os.Exit(0) + } + // not autocompleting. return go-arg & the application if !pb.IsAuto { // save the pb & history @@ -41,13 +49,6 @@ func Autocomplete(dest any) *Auto { return pb } - // user is trying to setup bash or zsh autocomplete - if pb.SetupAuto { - // --bash was passed. try to configure bash-completion - MakeAutocompleteFiles(myAuto.appName) - os.Exit(0) - } - // EVERYTHING PAST HERE IS FOR AUTOCOMPLETE // everything sent to STDOUT and STDERR matters past this point |
