summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
Diffstat (limited to 'alot')
-rw-r--r--alot/__main__.py35
-rw-r--r--alot/commands/envelope.py2
-rw-r--r--alot/commands/globals.py26
-rw-r--r--alot/commands/search.py7
-rw-r--r--alot/commands/thread.py6
-rw-r--r--alot/defaults/alot.rc.spec2
6 files changed, 42 insertions, 36 deletions
diff --git a/alot/__main__.py b/alot/__main__.py
index 0d100134..221e6b22 100644
--- a/alot/__main__.py
+++ b/alot/__main__.py
@@ -23,35 +23,40 @@ _SUBCOMMANDS = ['search', 'compose', 'bufferlist', 'taglist', 'namedqueries',
def parser():
"""Parse command line arguments, validate them, and return them."""
- parser = argparse.ArgumentParser()
- parser.add_argument('-v', '--version', action='version',
- version=alot.__version__)
+ parser = argparse.ArgumentParser(add_help=False)
parser.add_argument('-r', '--read-only', action='store_true',
- help='open db in read only mode')
- parser.add_argument('-c', '--config',
+ help='open notmuch database in read-only mode')
+ parser.add_argument('-c', '--config', metavar='FILENAME',
action=cargparse.ValidatedStoreAction,
validator=cargparse.require_file,
- help='config file')
- parser.add_argument('-n', '--notmuch-config', default=os.environ.get(
+ help='configuration file')
+ parser.add_argument('-n', '--notmuch-config', metavar='FILENAME',
+ default=os.environ.get(
'NOTMUCH_CONFIG',
os.path.expanduser('~/.notmuch-config')),
action=cargparse.ValidatedStoreAction,
validator=cargparse.require_file,
- help='notmuch config')
- parser.add_argument('-C', '--colour-mode',
+ help='notmuch configuration file')
+ parser.add_argument('-C', '--colour-mode', metavar='COLOURS',
choices=(1, 16, 256), type=int,
- help='terminal colour mode')
- parser.add_argument('-p', '--mailindex-path',
+ help='number of colours to use')
+ parser.add_argument('-p', '--mailindex-path', metavar='PATH',
action=cargparse.ValidatedStoreAction,
validator=cargparse.require_dir,
help='path to notmuch index')
- parser.add_argument('-d', '--debug-level', default='info',
+ parser.add_argument('-d', '--debug-level', metavar='LEVEL', default='info',
choices=('debug', 'info', 'warning', 'error'),
- help='debug log [default: %(default)s]')
- parser.add_argument('-l', '--logfile', default='/dev/null',
+ help='debug level [default: %(default)s]')
+ parser.add_argument('-l', '--logfile', metavar='FILENAME',
+ default='/dev/null',
action=cargparse.ValidatedStoreAction,
validator=cargparse.optional_file_like,
- help='logfile [default: %(default)s]')
+ help='log file [default: %(default)s]')
+ parser.add_argument('-h', '--help', action='help',
+ help='display this help and exit')
+ parser.add_argument('-v', '--version', action='version',
+ version=alot.__version__,
+ help='output version information and exit')
# We will handle the subcommands in a separate run of argparse as argparse
# does not support optional subcommands until now.
parser.add_argument('command', nargs=argparse.REMAINDER,
diff --git a/alot/commands/envelope.py b/alot/commands/envelope.py
index 94d746cc..000e14db 100644
--- a/alot/commands/envelope.py
+++ b/alot/commands/envelope.py
@@ -621,7 +621,7 @@ class EncryptCommand(Command):
@registerCommand(
MODE, 'retag', forced={'action': 'set'},
arguments=[(['tags'], {'help': 'comma separated list of tags'})],
- help='set message tags.',
+ help='set message tags',
)
@registerCommand(
MODE, 'untag', forced={'action': 'remove'},
diff --git a/alot/commands/globals.py b/alot/commands/globals.py
index 9ebf2859..e2a39000 100644
--- a/alot/commands/globals.py
+++ b/alot/commands/globals.py
@@ -38,16 +38,18 @@ from ..utils import argparse as cargparse
MODE = 'global'
-@registerCommand(MODE, 'exit')
+@registerCommand(MODE, 'exit', help="shut down cleanly")
class ExitCommand(Command):
- """Shut down cleanly.
-
- The _prompt variable is for internal use only, it's used to control
- prompting to close without sending, and is used by the BufferCloseCommand
- if settings change after yielding to the UI.
- """
+ """Shut down cleanly."""
def __init__(self, _prompt=True, **kwargs):
+ """
+ :param _prompt: For internal use only, used to control prompting to
+ close without sending, and is used by the
+ BufferCloseCommand if settings change after yielding to
+ the UI.
+ :type _prompt: bool
+ """
super(ExitCommand, self).__init__(**kwargs)
self.prompt_to_send = _prompt
@@ -352,7 +354,7 @@ class PythonShellCommand(Command):
@registerCommand(MODE, 'repeat')
class RepeatCommand(Command):
- """Repeats the command executed last time"""
+ """repeat the command executed last time"""
def __init__(self, **kwargs):
Command.__init__(self, **kwargs)
@@ -367,7 +369,7 @@ class RepeatCommand(Command):
(['command'], {'help': 'python command string to call'})])
class CallCommand(Command):
- """Executes python code"""
+ """execute python code"""
repeatable = True
def __init__(self, command, **kwargs):
@@ -616,8 +618,8 @@ class FlushCommand(Command):
(['commandname'], {'help': 'command or \'bindings\''})])
class HelpCommand(Command):
- """display help for a command. Use \'bindings\' to display all keybings
- interpreted in current mode.'"""
+ """display help for a command (use \'bindings\' to display all keybindings
+ interpreted in current mode)"""
def __init__(self, commandname='', **kwargs):
"""
:param commandname: command to document
@@ -984,7 +986,7 @@ class MoveCommand(Command):
priority='error')
-@registerCommand(MODE, 'reload', help='Reload all configuration files')
+@registerCommand(MODE, 'reload', help='reload all configuration files')
class ReloadCommand(Command):
"""Reload configuration."""
diff --git a/alot/commands/search.py b/alot/commands/search.py
index d1dccd71..2b8e4849 100644
--- a/alot/commands/search.py
+++ b/alot/commands/search.py
@@ -136,10 +136,9 @@ RetagPromptCommand = registerCommand(MODE, 'retagprompt')(RetagPromptCommand)
'default': 'True',
'help': 'postpone a writeout to the index'}),
(['tags'], {'help': 'comma separated list of tags'})],
- help='flip presence of tags on this thread. A tag is considered present '
- 'if at least one message contained in this thread is tagged with it. '
- 'In that case this command will remove the tag from every message in '
- 'the thread.')
+ help='flip presence of tags on this thread: a tag is considered present '
+ 'and will be removed if at least one message in this thread is '
+ 'tagged with it')
class TagCommand(Command):
"""manipulate message tags"""
diff --git a/alot/commands/thread.py b/alot/commands/thread.py
index b6eee44f..f2e85ad9 100644
--- a/alot/commands/thread.py
+++ b/alot/commands/thread.py
@@ -1069,9 +1069,9 @@ class MoveFocusCommand(MoveCommand):
@registerCommand(MODE, 'select')
class ThreadSelectCommand(Command):
- """select focussed element. The fired action depends on the focus:
- - if message summary, this toggles visibility of the message,
- - if attachment line, this opens the attachment"""
+ """select focussed element:
+ - if it is a message summary, toggle visibility of the message;
+ - if it is an attachment line, open the attachment"""
def apply(self, ui):
focus = ui.get_deep_focus()
if isinstance(focus, AttachmentWidget):
diff --git a/alot/defaults/alot.rc.spec b/alot/defaults/alot.rc.spec
index dfe5dd38..a2edcb37 100644
--- a/alot/defaults/alot.rc.spec
+++ b/alot/defaults/alot.rc.spec
@@ -23,7 +23,7 @@ bug_on_exit = boolean(default=False)
# offset of next focused buffer if the current one gets closed
bufferclose_focus_offset = integer(default=-1)
-# number of colours to use
+# number of colours to use on the terminal
colourmode = option(1, 16, 256, default=256)
# number of spaces used to replace tab characters