Skip to content

Instantly share code, notes, and snippets.

@cluelessperson
Created May 5, 2019 10:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cluelessperson/ac140dd761b502d9171009297511eb65 to your computer and use it in GitHub Desktop.
Save cluelessperson/ac140dd761b502d9171009297511eb65 to your computer and use it in GitHub Desktop.
@staticmethod
def _get_cli_config():
for i, arg in enumerate(sys.argv):
if "--" in arg and len(sys.argv)-1 > i:
key = arg[2:]
value = sys.argv[i+1]
yield (key, value)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment