Repository: conda/conda

Issue:
conda env config (or other inappropriate/incomplete commands) results in AttributeError(possibly related to argparse ?) 
<!--
Hi!  Read this; it's important.

This is an issue tracker for conda -- the package manager.  File feature requests
for conda here, as well as bug reports about something conda has messed up.

Anaconda Community Code of Conduct: https://www.anaconda.com/community-code-of-conduct/

If your issue is a bug report for:
  * a specific conda package from Anaconda ('defaults' channel):
      ==> file at https://github.com/ContinuumIO/anaconda-issues
  * a specific conda package from conda-forge:
      ==> file at the corresponding feedstock under https://github.com/conda-forge
  * repo.anaconda.com access and service:
      ==> file at https://github.com/ContinuumIO/anaconda-issues
  * anaconda.org access and service:
      ==> file at https://anaconda.org/contact/report
  * commands under 'conda build':
      ==> file at https://github.com/conda/conda-build
  * commands under 'conda env':
      ==> please file it here!
  * all other conda commands that start with 'conda':
      ==> please file it here!

If you continue on,

   **please include all requested information below.**

If a maintainer determines the information is required to understand 
your issue, and if it is not provided, your issue may be
closed automatically.

-->

## Current Behavior
<!-- What actually happens?
     If you want to include console output, please use "Steps to Reproduce" below. -->
```conda env config``` (or other options that are either incomplete or inappropriate,
such as ```conda env config vars```)
shows Error message including 
```
    Traceback (most recent call last):
      File "/home/USERNAME/miniconda3/lib/python3.7/site-packages/conda/exceptions.py", line 1078, in __call__
        return func(*args, **kwargs)
      File "/home/USERNAME/miniconda3/lib/python3.7/site-packages/conda_env/cli/main.py", line 76, in do_call
        relative_mod, func_name = args.func.rsplit('.', 1)
    AttributeError: 'Namespace' object has no attribute 'func'
```
This seems to be related to argparse behavior?
(p.s. USERNAME is in place for the username currently used, and ROOTUSERNAME is the (main) root username. ANOTHERFOLDER is just another folder.)

### Steps to Reproduce
<!-- If the current behavior is a bug, please provide specific, minimal steps to independently reproduce.
     Include the exact conda commands that reproduce the issue and their output between the ticks below. -->
```
conda env config

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "/home/USERNAME/miniconda3/lib/python3.7/site-packages/conda/exceptions.py", line 1078, in __call__
        return func(*args, **kwargs)
      File "/home/USERNAME/miniconda3/lib/python3.7/site-packages/conda_env/cli/main.py", line 76, in do_call
        relative_mod, func_name = args.func.rsplit('.', 1)
    AttributeError: 'Namespace' object has no attribute 'func'

`$ /home/USERNAME/miniconda3/bin/conda-env config vars`

  environment variables:
                 CIO_TEST=<not set>
  CONDA_AUTO_UPDATE_CONDA=false
        CONDA_DEFAULT_ENV=base
                CONDA_EXE=/home/USERNAME/miniconda3/bin/conda
             CONDA_PREFIX=/home/USERNAME/miniconda3
    CONDA_PROMPT_MODIFIER=(base)
         CONDA_PYTHON_EXE=/home/USERNAME/miniconda3/bin/python
               CONDA_ROOT=/home/USERNAME/miniconda3
              CONDA_SHLVL=1
                     PATH=/home/USERNAME/miniconda3/bin:/home/USERNAME/miniconda3/bin:/home/
                          USERNAME/miniconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/
                          usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/
                          java-8-openjdk-amd64/bin:/usr/lib/jvm/java-8-openjdk-
                          amd64/jre/bin:/home/ROOTUSERNAME/ANOTHERFOLDER/apache-maven-3.6.0/bin
       REQUESTS_CA_BUNDLE=<not set>
            SSL_CERT_FILE=<not set>

     active environment : base
    active env location : /home/USERNAME/miniconda3
            shell level : 1
       user config file : /home/USERNAME/.condarc
 populated config files : /home/USERNAME/.condarc
          conda version : 4.8.1
    conda-build version : not installed
         python version : 3.7.6.final.0
       virtual packages : __cuda=10.1
                          __glibc=2.27
       base environment : /home/USERNAME/miniconda3  (writable)
           channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /home/USERNAME/miniconda3/pkgs
                          /home/USERNAME/.conda/pkgs
       envs directories : /home/USERNAME/miniconda3/envs
                          /home/USERNAME/.conda/envs
               platform : linux-64
             user-agent : conda/4.8.1 requests/2.22.0 CPython/3.7.6 Linux/4.15.0-74-generic ubuntu/18.04.3 glibc/2.27
                UID:GID : 1010:1010
             netrc file : None
           offline mode : False
```


## Expected Behavior
<!-- What do you think should happen? -->
show error message or --help option equivalent output

## Environment Information
<details open><summary><code>`conda info`</code></summary><p>
<!-- between the ticks below, paste the output of 'conda info' -->

```
     active environment : base
    active env location : /home/USERNAME/miniconda3
            shell level : 1
       user config file : /home/USERNAME/.condarc
 populated config files : /home/USERNAME/.condarc
          conda version : 4.8.1
    conda-build version : not installed
         python version : 3.7.6.final.0
       virtual packages : __cuda=10.1
                          __glibc=2.27
       base environment : /home/USERNAME/miniconda3  (writable)
           channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /home/USERNAME/miniconda3/pkgs
                          /home/USERNAME/.conda/pkgs
       envs directories : /home/USERNAME/miniconda3/envs
                          /home/USERNAME/.conda/envs
               platform : linux-64
             user-agent : conda/4.8.1 requests/2.22.0 CPython/3.7.6 Linux/4.15.0-74-generic ubuntu/18.04.3 glibc/2.27
                UID:GID : 1010:1010
             netrc file : None
           offline mode : False
```
</p></details>


<details open><summary><code>`conda config --show-sources`</code></summary><p>
<!-- between the ticks below, paste the output of 'conda config --show-sources' -->

```
==> /home/USERNAME/.condarc <==
channels:
  - defaults
```
</p></details>


<details><summary><code>`conda list --show-channel-urls`</code></summary><p>
<!-- between the ticks below, paste the output of 'conda list --show-channel-urls' -->

```
# packages in environment at /home/USERNAME/miniconda3:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main    defaults
asn1crypto                1.3.0                    py37_0    defaults
ca-certificates           2019.11.27                    0    defaults
certifi                   2019.11.28               py37_0    defaults
cffi                      1.13.2           py37h2e261b9_0    defaults
chardet                   3.0.4                 py37_1003    defaults
conda                     4.8.1                    py37_0    defaults
conda-package-handling    1.6.0            py37h7b6447c_0    defaults
cryptography              2.8              py37h1ba5d50_0    defaults
idna                      2.8                      py37_0    defaults
ld_impl_linux-64          2.33.1               h53a641e_7    defaults
libedit                   3.1.20181209         hc058e9b_0    defaults
libffi                    3.2.1                hd88cf55_4    defaults
libgcc-ng                 9.1.0                hdf63c60_0    defaults
libstdcxx-ng              9.1.0                hdf63c60_0    defaults
ncurses                   6.1                  he6710b0_1    defaults
openssl                   1.1.1d               h7b6447c_3    defaults
pip                       19.3.1                   py37_0    defaults
pycosat                   0.6.3            py37h7b6447c_0    defaults
pycparser                 2.19                     py37_0    defaults
pyopenssl                 19.1.0                   py37_0    defaults
pysocks                   1.7.1                    py37_0    defaults
python                    3.7.6                h0371630_2    defaults
readline                  7.0                  h7b6447c_5    defaults
requests                  2.22.0                   py37_1    defaults
ruamel_yaml               0.15.87          py37h7b6447c_0    defaults
setuptools                44.0.0                   py37_0    defaults
six                       1.13.0                   py37_0    defaults
sqlite                    3.30.1               h7b6447c_0    defaults
tk                        8.6.8                hbc83047_0    defaults
tqdm                      4.41.1                     py_0    defaults
urllib3                   1.25.7                   py37_0    defaults
wheel                     0.33.6                   py37_0    defaults
xz                        5.2.4                h14c3975_4    defaults
yaml                      0.1.7                had09818_2    defaults
zlib                      1.2.11               h7b6447c_3    defaults
```
</p></details>



Discussion:
Can confirm this also happens on ```Windows 10 (x86_64), same conda version``` installed through anaconda.
Anybody else on mac who can check/confirm this behavior?
I never recall seeing this behavior before, so I assume this might occur due to changes in ```conda 4.8.1```. Though if one uses ```conda``` in an 'appropriate way' no problems will occur, it is very annoying(and technically a bug since a predictable Exception is not caught). However, I am not sure of what the anticipated behavior is, so I cannot pinpoint/PR on this issue.


Resolving patch:
diff --git a/conda_env/cli/main_config.py b/conda_env/cli/main_config.py
--- a/conda_env/cli/main_config.py
+++ b/conda_env/cli/main_config.py
@@ -24,5 +24,10 @@ def configure_parser(sub_parsers):
         help=config_description,
         epilog=config_example,
     )
+    config_parser.set_defaults(func='.main_config.execute')
     config_subparser = config_parser.add_subparsers()
     configure_vars_parser(config_subparser)
+
+
+def execute(args, parser):
+    parser.parse_args(['config', '--help'])


Test patch: