@@ -0,0 +1,1458 @@
+import os%0Aimport json%0Aimport getpass%0Aimport argparse%0A%0Aimport ilms%0Afrom ilms.core import User, Core as iLms%0A%0Aparser = argparse.ArgumentParser()%0Aparser.add_argument(%0A    'action', help=('login / download / view'))%0Aparser.add_argument(%0A    '--courses', action='store_true', help='List all courses in this semester.')%0Aparser.add_argument(%0A    '-c', '--course_id', type=str, help='Specific course to view.')%0Aparser.add_argument(%0A    '-V', '--version', action='version', version=ilms.__version__)%0A%0A%0Adef get_account():%0A    global _account, _password%0A    _config = %7B'account': input('iLms account:'),%0A               'password': getpass.getpass(prompt='Password:')%7D%0A    _account = _config.get('account')%0A    _password = _config.get('password')%0A    with open(_config_file, 'w') as f:%0A        f.write(json.dumps(_config, indent=4))%0A%0A%0A_config_file = os.path.expanduser(os.path.join(ilms._ilms_dir, 'ilms.json'))%0A%0Aif os.path.exists(_config_file):%0A    _config = json.load(open(_config_file))%0A    _account = _config.get('account')%0A    _password = _config.get('password')%0A    if not _account or not _password:%0A        get_account()%0A%0Aif not os.path.exists(_config_file):%0A    get_account()%0A%0A%0Adef print_course_list(ilms):%0A    for cou in ilms.get_courses():%0A        print(cou)%0A%0A%0Adef main(args=None):%0A    args = args or parser.parse_args()%0A%0A    user = User(_account, _password)%0A    assert user.login()%0A%0A    ilms = iLms(user)%0A%0A    if args.courses:%0A        print_course_list(ilms)%0A

add simple cli commands structure