Repository: funcx-faas/funcx
Issue: funcx-endpoint autocomplete is buggy

**Describe the bug**
Tab completing endpoint names for example in a command like `funcx-endpoint start <endpoint_name_>` fails.

**To Reproduce**
Steps to reproduce the behavior, for e.g:
1. Install funcx==0.2.2 and funcx-endpoint==0.2.2 with Python 3.7 on cluster
2. funcx-endpoint start endp\\TAB
3. This prints an error and then hangs:
```
funcx-endpoint start teTraceback (most recent call last):
  File "/home/yadu/anaconda3/envs/funcx_py3.7/bin/funcx-endpoint", line 8, in <module>
    sys.exit(cli_run())
  File "/home/yadu/anaconda3/envs/funcx_py3.7/lib/python3.7/site-packages/funcx_endpoint/endpoint/endpoint.py", line 185, in cli_run
    app()
  File "/home/yadu/anaconda3/envs/funcx_py3.7/lib/python3.7/site-packages/typer/main.py", line 214, in __call__
    return get_command(self)(*args, **kwargs)
  File "/home/yadu/anaconda3/envs/funcx_py3.7/lib/python3.7/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/yadu/anaconda3/envs/funcx_py3.7/lib/python3.7/site-packages/click/core.py", line 777, in main
    _bashcomplete(self, prog_name, complete_var)
  File "/home/yadu/anaconda3/envs/funcx_py3.7/lib/python3.7/site-packages/click/core.py", line 72, in _bashcomplete
    if bashcomplete(cmd, prog_name, complete_var, complete_instr):
  File "/home/yadu/anaconda3/envs/funcx_py3.7/lib/python3.7/site-packages/typer/completion.py", line 447, in handle_shell_complete
    return do_shell_complete(cli=cli, prog_name=prog_name, shell=shell)
  File "/home/yadu/anaconda3/envs/funcx_py3.7/lib/python3.7/site-packages/typer/completion.py", line 395, in do_shell_complete
    return do_bash_complete(cli, prog_name)
  File "/home/yadu/anaconda3/envs/funcx_py3.7/lib/python3.7/site-packages/typer/completion.py", line 314, in do_bash_complete
    for item in click._bashcomplete.get_choices(cli, prog_name, args, incomplete):
  File "/home/yadu/anaconda3/envs/funcx_py3.7/lib/python3.7/site-packages/click/_bashcomplete.py", line 318, in get_choices
    return get_user_autocompletions(ctx, all_args, incomplete, param)
  File "/home/yadu/anaconda3/envs/funcx_py3.7/lib/python3.7/site-packages/click/_bashcomplete.py", line 229, in get_user_autocompletions
    c if isinstance(c, tuple) else (c, None) for c in dynamic_completions
  File "/home/yadu/anaconda3/envs/funcx_py3.7/lib/python3.7/site-packages/click/_bashcomplete.py", line 229, in <listcomp>
    c if isinstance(c, tuple) else (c, None) for c in dynamic_completions
  File "/home/yadu/anaconda3/envs/funcx_py3.7/lib/python3.7/site-packages/funcx_endpoint/endpoint/endpoint.py", line 45, in complete_endpoint_name
    config_files = glob.glob(os.path.join(manager.funcx_dir, '*', 'config.py'))
NameError: name 'manager' is not defined
```

**Expected behavior**
Either the autocomplete works, or it doesn't. When it doesn't it should just not do anything and let the user type out the endpoint name.

**Environment**
- affects everything

**Distributed Environment**
- all situations with an endpoint

Changed files:
funcx_endpoint/funcx_endpoint/endpoint/endpoint.py

diff --git a/funcx_endpoint/funcx_endpoint/endpoint/endpoint.py b/funcx_endpoint/funcx_endpoint/endpoint/endpoint.py
index d7eaf26f..34656fca 100644
--- a/funcx_endpoint/funcx_endpoint/endpoint/endpoint.py
+++ b/funcx_endpoint/funcx_endpoint/endpoint/endpoint.py
@@ -42,7 +42,10 @@ def version_callback(value):
 
 
 def complete_endpoint_name():
-    config_files = glob.glob(os.path.join(manager.funcx_dir, '*', 'config.py'))
+    # Manager context is not initialized at this point, so we assume the default
+    # the funcx_dir path of ~/.funcx
+    funcx_dir = os.path.join(pathlib.Path.home(), '.funcx')
+    config_files = glob.glob(os.path.join(funcx_dir, '*', 'config.py'))
     for config_file in config_files:
         yield os.path.basename(os.path.dirname(config_file))