B612-Asteroid-Institute / adam_home

ADAM python client and notebooks
MIT License
14 stars 8 forks source link

If adamctl login has more than just the `login` argument, require both the profile name and server url #132

Open carise opened 3 years ago

carise commented 3 years ago

Do some tighter argument parsing/validation.

e.g. The command to get the credentials for the ADAM CLI is adamctl login, with optional profile name and server url. However, sometimes I've noticed users forgetting the profile name:

$ adamctl login https://serverurl/_ah/api/adam/v1
Setting up a configuration named 'https://serverurl/_ah/api/adam/v1' for the server: 'None'.
Please go to b''://b''/token.html in your web browser, log in using a GMail or GSuite account, and paste your token in this terminal (won't be printed to the screen).
We'll try to automatically open a web browser for you (press ENTER to continue)

Error Code: INET_E_CANNOT_CONNECT

We should really be exiting the operation and telling the user that the usage is adamctl login OR adamctl login profile_name url.