A more uniform help.

This commit is contained in:
Arun Prakash Jana 2016-04-26 03:58:59 +05:30
parent 923b5b7e34
commit aaa85e7857
No known key found for this signature in database
GPG Key ID: C0A712ED95043DCB

21
buku
View File

@ -1034,7 +1034,7 @@ class ExtendedArgumentParser(argparse.ArgumentParser):
def print_extended_help(file=None): def print_extended_help(file=None):
file.write(textwrap.dedent(""" file.write(textwrap.dedent("""
prompt keys: prompt keys:
1-N open Nth search result in browser 1-N open the Nth search result in web browser
Enter exit buku Enter exit buku
Version %.1f Version %.1f
@ -1063,20 +1063,21 @@ addarg('-d', '--delete', nargs='?', dest='delete', type=int, const=0, metavar='N
"delete all bookmarks, if N is omitted\n" "delete all bookmarks, if N is omitted\n"
" ") " ")
addarg('-s', '--sany', nargs='+', metavar='KEYWORD', addarg('-s', '--sany', nargs='+', metavar='KEYWORD',
help="search bookmarks for any keyword\n" help="search bookmarks for ANY matching keyword\n"
" ") " ")
addarg('-S', '--sall', nargs='+', metavar='KEYWORD', addarg('-S', '--sall', nargs='+', metavar='KEYWORD',
help="search bookmarks with all keywords\n" help="search bookmarks with ALL keywords\n"
"keyword='tags' : list all tags alphabetically\n" "special keywords:\n"
"keyword='blank': list entries with empty title/tag\n" "'tags' - list all tags alphabetically\n"
"'blank'- list entries with empty title/tag\n"
" ") " ")
addarg('-t', '--title', dest='titleManual', metavar='title', addarg('-t', '--title', dest='titleManual', metavar='title',
help="manually set title, works with -a, -u\n" help="manually set title, works with -a, -u\n"
"title='blank': clear title\n" "title='blank': clear title\n"
" ") " ")
addarg('-u', '--update', nargs='*', dest='update', action=customAction, metavar=('N', 'URL tags'), addarg('-u', '--update', nargs='*', dest='update', action=customAction, metavar=('N', 'URL tags'),
help="update fields of the bookmark at DB index N\n" help="update fields of bookmark at DB index N\n"
"if URL is omitted (and -m is not used), refresh\n" "if URL is omitted (and -m unused), refresh\n"
"title of bookmark at index N from the web;\n" "title of bookmark at index N from the web;\n"
"refresh all titles, if N is omitted\n" "refresh all titles, if N is omitted\n"
" ") " ")
@ -1094,14 +1095,14 @@ addarg('-l', '--lock', nargs='?', dest='encrypt', type=int, const=8, metavar='N'
"hash iterations to generate key\n" "hash iterations to generate key\n"
" ") " ")
addarg('-o', '--open', dest='openurl', type=int, metavar='N', addarg('-o', '--open', dest='openurl', type=int, metavar='N',
help="open bookmark at DB index N in browser\n" help="open bookmark at DB index N in web browser\n"
" ") " ")
addarg('-p', '--print', nargs='?', dest='printindex', type=int, const=0, metavar='N', addarg('-p', '--print', nargs='?', dest='printindex', type=int, const=0, metavar='N',
help="show details of bookmark at DB index N\n" help="show details of bookmark at DB index N\n"
"show all bookmarks, if N is omitted\n" "show all bookmarks, if N is omitted\n"
" ") " ")
addarg('-r', '--replace', nargs=2, dest='replace', metavar=('oldtag', 'newtag'), addarg('-r', '--replace', nargs=2, dest='replace', metavar=('oldtag', 'newtag'),
help="replace oldtag with newtag\n" help="replace oldtag with newtag for all bookmarks\n"
"newtag='blank': delete oldtag\n" "newtag='blank': delete oldtag\n"
" ") " ")
addarg('-x', '--format', dest='showOpt', type=int, choices=[1, 2], metavar='N', addarg('-x', '--format', dest='showOpt', type=int, choices=[1, 2], metavar='N',
@ -1109,7 +1110,7 @@ addarg('-x', '--format', dest='showOpt', type=int, choices=[1, 2], metavar='N',
"N=1: show only URL, N=2: show URL and tag\n" "N=1: show only URL, N=2: show URL and tag\n"
" ") " ")
addarg('-z', '--debug', dest='debug', action='store_true', addarg('-z', '--debug', dest='debug', action='store_true',
help="show debug information") help="show debug information and additional logs")
if len(sys.argv) < 2: if len(sys.argv) < 2:
argparser.print_help(sys.stderr) argparser.print_help(sys.stderr)