18 lines
515 B
Python
18 lines
515 B
Python
#!/usr/bin/env python
|
|
# -*- coding: utf-8 -*-
|
|
|
|
import sys
|
|
|
|
def obtenir ( option, fallback=False ) :
|
|
'''String -> String/Boolean
|
|
Si l'option demandée n'existe pas, renvoie False.
|
|
Si l'option demandée existe'''
|
|
if option in sys.argv:
|
|
index = sys.argv.index( option ) + 1
|
|
if len( sys.argv ) > index :
|
|
print type( sys.argv[ index - 1 ])
|
|
print type( sys.argv[ index ])
|
|
print sys.argv[ index ]
|
|
return sys.argv[ index ]
|
|
return fallback
|