0

I am new to command line tools. I am trying to build a Google Drive command line client. I am trying to use Docopt. This is what my main file looks like:

"""
GDR Google Drive Command Line Client.

Usage:
  gdr.py about
  gdr.py upload <filename>
  gdr.py listall
  gdr.py search <keyword>
  gdr.py -h | --help
  gdr.py --version

Options:
  -h --help     Show this screen.
  --version     Show version.
"""
from docopt import docopt
from Commands.about import About

if __name__ == '__main__':
    arguments = docopt(__doc__)
    print(arguments)

    if arguments['about'] == True:
        About.aboutMe()

It works perfectly until I call aboutMe() method. But when I call it I get the following error:

Himanshu-Mac:GDrive himanshu$ python gdr.py about
usage: gdr.py [-h] [--auth_host_name AUTH_HOST_NAME]
              [--noauth_local_webserver]
              [--auth_host_port [AUTH_HOST_PORT [AUTH_HOST_PORT ...]]]
              [--logging_level {DEBUG,INFO,WARNING,ERROR,CRITICAL}]
gdr.py: error: unrecognized arguments: about

Where is the problem? I need help in this. And also this is my first question on stackoverflow so apologies if my format is not correct.

1 Answers1

0

It looks like you are calling a different program. The usage output does not correspond to the code you have given. Are you sure you are running the right program? Try catting it.

J. P. Petersen
  • 4,871
  • 4
  • 33
  • 33
  • Yes that is the exact problem. It is nowhere in my code still I am getting this error. I researched a little bit, problem may lie with google authorisation that I do in aboutme() method. – Himanshu Mishra Nov 07 '16 at 05:38