Add dedicated server help menu

This commit is contained in:
2022-10-04 14:37:04 -04:00
parent aadca0ad44
commit c009dd63ab
+25 -4
View File
@@ -301,7 +301,8 @@ def print_info(): # prints help text based on argument
if argument_list[1] == 'help' or argument_list[1] == '--help' or argument_list[1] == '-h': if argument_list[1] == 'help' or argument_list[1] == '--help' or argument_list[1] == '-h':
print('\n\u001b[1msshyp copyright (c) 2021-2022 randall winkhart\u001b[0m\n') print('\n\u001b[1msshyp copyright (c) 2021-2022 randall winkhart\u001b[0m\n')
print("this is free software, and you are welcome to redistribute it under certain conditions;\nthis program " print("this is free software, and you are welcome to redistribute it under certain conditions;\nthis program "
"comes with absolutely no warranty;\ntype `sshyp license' for details") "comes with absolutely no warranty;\ntype 'sshyp license' for details")
if device_type == 'c':
print('\n\u001b[1musage:\u001b[0m sshyp [option [flag] [<entry name>]] | [/<entry name>]\n') print('\n\u001b[1musage:\u001b[0m sshyp [option [flag] [<entry name>]] | [/<entry name>]\n')
print('\u001b[1moptions:\u001b[0m') print('\u001b[1moptions:\u001b[0m')
print('help/--help/-h bring up this menu') print('help/--help/-h bring up this menu')
@@ -330,8 +331,20 @@ def print_info(): # prints help text based on argument
print(' url/-l copy the url of an entry to your clipboard') print(' url/-l copy the url of an entry to your clipboard')
print(' note/-n copy the note of an entry to your clipboard') print(' note/-n copy the note of an entry to your clipboard')
print('gen:') print('gen:')
print(' update/-u generate a password for an existing entry\n') print(' update/-u generate a password for an existing entry')
print("\u001b[1mtip:\u001b[0m you can quickly read an entry with 'sshyp /<entry name>'") print("\n\u001b[1mtip:\u001b[0m you can quickly read an entry with 'sshyp /<entry name>'")
else:
print('\n\u001b[1musage:\u001b[0m sshyp [option [flag] [<device id>]]\n')
print('\u001b[1moptions:\u001b[0m')
print('help/--help/-h bring up this menu')
print('version/-v display sshyp version info')
print('tweak configure sshyp')
print('whitelist manage the quick-unlock whitelist')
print('\u001b[1mflags:\u001b[0m')
print('whitelist:')
print(' list/-l view all registered device ids and their quick unlock whitelist status')
print(' add whitelist a device id for quick unlock')
print(' delete/del remove a device id from the quick unlock whitelist')
elif argument_list[1] == 'version' or argument_list[1] == '-v': elif argument_list[1] == 'version' or argument_list[1] == '-v':
print('\nsshyp is a simple, self-hosted, sftp-synchronized password manager\nfor unix(-like) systems (haiku/' print('\nsshyp is a simple, self-hosted, sftp-synchronized password manager\nfor unix(-like) systems (haiku/'
'freebsd/linux/termux)\n\nsshyp is a viable alternative to (and compatible with) pass/password-store\n') 'freebsd/linux/termux)\n\nsshyp is a viable alternative to (and compatible with) pass/password-store\n')
@@ -384,6 +397,13 @@ def print_info(): # prints help text based on argument
print(' password/-p copy the password of an entry to your clipboard') print(' password/-p copy the password of an entry to your clipboard')
print(' url/-l copy the url of an entry to your clipboard') print(' url/-l copy the url of an entry to your clipboard')
print(' note/-n copy the note of an entry to your clipboard\n') print(' note/-n copy the note of an entry to your clipboard\n')
elif argument_list[1] == 'whitelist' and device_type != 'c':
print('\n\u001b[1musage:\u001b[0m sshyp whitelist [flag [<device id>]]\u001b[0m\n')
print('\u001b[1mflags:\u001b[0m')
print('whitelist:')
print(' list/-l view all registered device ids and their quick unlock whitelist status')
print(' add whitelist a device id for quick unlock')
print(' delete/del remove a device id from the quick unlock whitelist\n')
def no_arg(): # displays a list of entries and gives an option to select one for viewing def no_arg(): # displays a list of entries and gives an option to select one for viewing
@@ -684,7 +704,8 @@ if __name__ == "__main__":
if ssh_error != 0: if ssh_error != 0:
ssh_error = copy_name_check(port, username_ssh, ip, client_device_name) ssh_error = copy_name_check(port, username_ssh, ip, client_device_name)
elif argument_list[1] != "help" and argument_list[1] != "--help" and argument_list[1] != "-h" and \ elif argument_list[1] != "help" and argument_list[1] != "--help" and argument_list[1] != "-h" and \
argument_list[1] != "license" and argument_list[1] != "version" and argument_list[1] != "-v": argument_list[1] != "license" and argument_list[1] != "version" and argument_list[1] != "-v" \
and argument_list[1] != "whitelist":
print(f"\n\u001b[38;5;9merror: invalid server argument - run 'sshyp help' to " print(f"\n\u001b[38;5;9merror: invalid server argument - run 'sshyp help' to "
f"list usable commands\u001b[0m\n") f"list usable commands\u001b[0m\n")
s_exit(0) s_exit(0)