Update add_user.py

This commit is contained in:
Saifeddine ALOUI 2024-01-16 09:46:10 +01:00 committed by GitHub
parent 19500578f6
commit debb1a631d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -20,8 +20,11 @@ def add_user(users_list=None):
f.write(f'{user_name}: {key}\n')
print(f'User {user_name} added to the authorized users list')
if __name__ == '__main__':
def main():
if len(sys.argv) > 1 and sys.argv[1] == '--users_list':
add_user(Path(sys.argv[2]))
else:
add_user()
if __name__ == '__main__':
main()