Ensured help text is always displayed with consistent spacing

Former-commit-id: b4e9c8d48a2311c586a29afd115925611e4cbe37
Former-commit-id: 632ea6a1c09491351d0e5f5862a463098e7db6e2
This commit is contained in:
2023-04-25 12:12:06 -04:00
parent 1f21ad571e
commit 9d41523c32
+78 -78
View File
@@ -358,95 +358,95 @@ def print_info():
'warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\nSee the GNU General Public License for' 'warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\nSee the GNU General Public License for'
' more details.\n\nhttps://opensource.org/licenses/GPL-3.0\n') ' more details.\n\nhttps://opensource.org/licenses/GPL-3.0\n')
elif arguments[0] == 'add' and device_type == 'client': elif arguments[0] == 'add' and device_type == 'client':
print('\n\u001b[1musage:\u001b[0m sshyp </entry name> add <flag>\u001b[0m\n') print(f"""\n\u001b[1musage:\u001b[0m sshyp </entry name> add <flag>\u001b[0m\n
print('\u001b[1mflags:\u001b[0m') \u001b[1mflags:\u001b[0m
print(' add:') add:
print(' password/-p\t\tadd a password entry') password/-p{12*' '}add a password entry
print(' note/-n\t\tadd a note entry') note/-n{16*' '}add a note entry
print(' folder/-f\t\tadd a new folder for entries\n') folder/-f{14*' '}add a new folder for entries\n""")
elif arguments[0] == 'edit' and device_type == 'client': elif arguments[0] == 'edit' and device_type == 'client':
print('\n\u001b[1musage:\u001b[0m sshyp </entry name> edit <flag>\u001b[0m\n') print(f"""\n\u001b[1musage:\u001b[0m sshyp </entry name> edit <flag>\u001b[0m\n
print('\u001b[1mflags:\u001b[0m') \u001b[1mflags:\u001b[0m
print(' edit:') edit:
print(' rename/relocate/-r\trename or relocate an entry') rename/relocate/-r{5*' '}rename or relocate an entry
print(' username/-u\t\tchange the username of an entry') username/-u{12*' '}change the username of an entry
print(' password/-p\t\tchange the password of an entry') password/-p{12*' '}change the password of an entry
print(' url/-l\t\tchange the url attached to an entry') url/-l{17*' '}change the url attached to an entry
print(' note/-n\t\tchange the note attached to an entry\n') note/-n{16*' '}change the note attached to an entry\n""")
elif arguments[0] == 'copy' and device_type == 'client': elif arguments[0] == 'copy' and device_type == 'client':
print('\n\u001b[1musage:\u001b[0m sshyp </entry name> copy <flag>\u001b[0m\n') print(f"""\n\u001b[1musage:\u001b[0m sshyp </entry name> copy <flag>\u001b[0m\n
print('\u001b[1mflags:\u001b[0m') \u001b[1mflags:\u001b[0m
print(' copy:') copy:
print(' username/-u\t\tcopy the username of an entry to your clipboard') username/-u{12*' '}copy the username of an entry to your clipboard
print(' password/-p\t\tcopy the password of an entry to your clipboard') password/-p{12*' '}copy the password of an entry to your clipboard
print(' url/-l\t\tcopy the url of an entry to your clipboard') url/-l{17*' '}copy the url of an entry to your clipboard
print(' note/-n\t\tcopy the note of an entry to your clipboard\n') note/-n{16*' '}copy the note of an entry to your clipboard\n""")
elif arguments[0] == 'gen' and device_type == 'client': elif arguments[0] == 'gen' and device_type == 'client':
print('\n\u001b[1musage:\u001b[0m sshyp </entry name> gen [flag]\u001b[0m\n') print(f"""\n\u001b[1musage:\u001b[0m sshyp </entry name> gen [flag]\u001b[0m\n
print('\u001b[1mflags:\u001b[0m') \u001b[1mflags:\u001b[0m
print(' gen:') gen:
print(' update/-u\t\tgenerate a password for an existing entry\n') update/-u{14*' '}generate a password for an existing entry\n""")
elif arguments[0] == 'whitelist': elif arguments[0] == 'whitelist':
if device_type == 'server': if device_type == 'server':
print('\n\u001b[1musage:\u001b[0m sshyp whitelist <flag> [device id]\u001b[0m\n') print(f"""\n\u001b[1musage:\u001b[0m sshyp whitelist <flag> [device id]\u001b[0m\n
print('\u001b[1mflags:\u001b[0m') \u001b[1mflags:\u001b[0m
print(' whitelist:') whitelist:
print(' setup\t\t\tset up the quick-unlock whitelist') setup{18*' '}set up the quick-unlock whitelist
print(' list/-l\t\tview all registered device ids and their quick-unlock whitelist status') list/-l{16*' '}view all registered device ids and their quick-unlock whitelist status
print(' add\t\t\twhitelist a device id for quick-unlock') add{20*' '}whitelist a device id for quick-unlock
print(' del\t\t\tremove a device id from the quick-unlock whitelist\n') del{20*' '}remove a device id from the quick-unlock whitelist\n""")
else: else:
print('\n\u001b[38;5;9merror: argument (whitelist) only available on server\u001b[0m\n') print('\n\u001b[38;5;9merror: argument (whitelist) only available on server\u001b[0m\n')
else: else:
print('\n\u001b[1msshyp copyright (c) 2021-2023 randall winkhart\u001b[0m\n') print("""\n\u001b[1msshyp copyright (c) 2021-2023 randall winkhart\u001b[0m
print("this is free software, and you are welcome to redistribute it under certain conditions;\nthis program " this is free software, and you are welcome to redistribute it under certain conditions;
"comes with absolutely no warranty;\ntype 'sshyp license' for details") this program comes with absolutely no warranty; type 'sshyp license' for details""")
if device_type == 'client': if device_type == 'client':
print('\n\u001b[1musage:\u001b[0m sshyp [</entry name> [option] [flag]] [option]\n') print(f"""\n\u001b[1musage:\u001b[0m sshyp [</entry name> [option] [flag]] [option]\n
print('\u001b[1moptions:\u001b[0m') \u001b[1moptions:\u001b[0m
print(' help/-h\t\tbring up this menu') help/-h{17*' '}bring up this menu
print(' version/-v\t\tdisplay sshyp version info') version/-v{14*' '}display sshyp version info
print(' tweak\t\t\tconfigure sshyp') tweak{19*' '}configure sshyp
print(' add\t\t\tadd an entry') add{21*' '}add an entry
print(' gen\t\t\tgenerate a new password') gen{21*' '}generate a new password
print(' edit\t\t\tedit an existing entry') edit{20*' '}edit an existing entry
print(' copy\t\t\tcopy details of an entry to your clipboard') copy{20*' '}copy details of an entry to your clipboard
print(' shear\t\t\tdelete an existing entry') shear{19*' '}delete an existing entry
print(' sync\t\t\tmanually sync the entry directory via sshync') sync{20*' '}manually sync the entry directory via sshync
print('\n\u001b[1mflags:\u001b[0m') \n\u001b[1mflags:\u001b[0m
print(' add:') add:
print(' password/-p\t\tadd a password entry') password/-p{12*' '}add a password entry
print(' note/-n\t\tadd a note entry') note/-n{16*' '}add a note entry
print(' folder/-f\t\tadd a new folder for entries') folder/-f{14*' '}add a new folder for entries
print(' edit:') edit:
print(' rename/relocate/-r\trename or relocate an entry') rename/relocate/-r{5*' '}rename or relocate an entry
print(' username/-u\t\tchange the username of an entry') username/-u{12*' '}change the username of an entry
print(' password/-p\t\tchange the password of an entry') password/-p{12*' '}change the password of an entry
print(' url/-l\t\tchange the url attached to an entry') url/-l{17*' '}change the url attached to an entry
print(' note/-n\t\tchange the note attached to an entry') note/-n{16*' '}change the note attached to an entry
print(' copy:') copy:
print(' username/-u\t\tcopy the username of an entry to your clipboard') username/-u{12*' '}copy the username of an entry to your clipboard
print(' password/-p\t\tcopy the password of an entry to your clipboard') password/-p{12*' '}copy the password of an entry to your clipboard
print(' url/-l\t\tcopy the url of an entry to your clipboard') url/-l{17*' '}copy the url of an entry to your clipboard
print(' note/-n\t\tcopy the note of an entry to your clipboard') note/-n{16*' '}copy the note of an entry to your clipboard
print(' gen:') gen:
print(' update/-u\t\tgenerate a password for an existing entry') update/-u{14*' '}generate a password for an existing entry
print("\n\u001b[1mtip 1:\u001b[0m you can quickly read an entry with 'sshyp </entry name>'") \n\u001b[1mtip 1:\u001b[0m you can quickly read an entry with 'sshyp </entry name>'
print("\u001b[1mtip 2:\u001b[0m type 'sshyp' to view a list of saved entries\n") \u001b[1mtip 2:\u001b[0m type 'sshyp' to view a list of saved entries\n""")
# PORT START HELP-SERVER # PORT START HELP-SERVER
else: else:
print('\n\u001b[1musage:\u001b[0m sshyp <option> [flag] [<device id>]\n') print(f"""\n\u001b[1musage:\u001b[0m sshyp <option> [flag] [<device id>]\n
print('\u001b[1moptions:\u001b[0m') \u001b[1moptions:\u001b[0m
print(' help/-h\t\tbring up this menu') help/-h{17*' '}bring up this menu
print(' version/-v\t\tdisplay sshyp version info') version/-v{14*' '}display sshyp version info
print(' tweak\t\t\tconfigure sshyp') tweak{19*' '}configure sshyp
print(' whitelist\t\tmanage the quick-unlock whitelist') whitelist{15*' '}manage the quick-unlock whitelist
print('\n\u001b[1mflags:\u001b[0m') \n\u001b[1mflags:\u001b[0m
print(' whitelist:') whitelist:
print(' setup\t\t\tset up the quick-unlock whitelist') setup{18*' '}set up the quick-unlock whitelist
print(' list/-l\t\tview all registered device ids and their quick-unlock whitelist status') list/-l{16*' '}view all registered device ids and their quick-unlock whitelist status
print(' add\t\t\twhitelist a device id for quick-unlock') add{20*' '}whitelist a device id for quick-unlock
print(' del\t\t\tremove a device id from the quick-unlock whitelist\n') del{20*' '}remove a device id from the quick-unlock whitelist\n""")
# PORT END HELP-SERVER # PORT END HELP-SERVER