diff --git a/README.md b/README.md index 3510eda..d39828b 100644 --- a/README.md +++ b/README.md @@ -9,3 +9,50 @@ APIs for the Unit hacklab. Requirements: * Python >= 3.5 + + +Create a virtual environment and activate it (optional): +``` +virtualenv --python=/usr/bin/python3 env +source env/bin/activate +``` + +Run the setup: +``` +python setup.py install +``` + +## Setup + +In the ldap section of `config.yml` change host, port and password according to +your setup. + + +## Command Line + +``` +usage: phicli [-h] [--config config.yml] + {showuser,adduser,deluser,showgroup,listgroups,addtogroup} ... + +optional arguments: + -h, --help show this help message and exit + --config config.yml custom configuration file + +actions: + showuser dispaly user fields + adduser add a new user + deluser delete an user + showgroup show a group + listgroups list all groups + addtogroup add an user to a group +``` + +``` +phicli showuser [-h] user_id +phicli adduser [-h] user_id +phicli deluser [-h] user_id + +phicli showgroup [-h] common_name +phicli listgroups [-h] +phicli addtogroup [-h] user_id group_common_name +``` diff --git a/src/phicli b/src/phicli index 763baf2..ee6ba16 100755 --- a/src/phicli +++ b/src/phicli @@ -45,7 +45,7 @@ def adduser(uid): print('\nuid: {}\n{}\n\n'.format(uid, pp(user))) -@cli.register('delete an unser', ['user identifier']) +@cli.register('delete an user', ['user identifier']) def deluser(uid): check = input('Are you sure? [y/N] ') or 'N' if check.lower() != 'y':