aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2024-06-27 00:28:18 +0200
committerRobin Jarry <robin@jarry.cc>2024-06-28 23:28:53 +0200
commitc15c265f7bcd6b0568b9d259673b7f302602f250 (patch)
treec9a625ca3ddc10eda1650a0aafdfaebd055afcb3
parent8e1f1dc199e1ea05cfd1319aa9338609e3ab3af6 (diff)
downloadaerc-c15c265f7bcd6b0568b9d259673b7f302602f250.tar.gz
main: add aliases for flags and options
Add --help and --version as aliases of -h and -v, respectively. Also add short flags for other options. Reported-by: Peter Sanchez <pjs@petersanchez.com> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
-rw-r--r--doc/aerc.1.scd15
-rw-r--r--main.go32
2 files changed, 28 insertions, 19 deletions
diff --git a/doc/aerc.1.scd b/doc/aerc.1.scd
index 60b8dd27..3a33fbd9 100644
--- a/doc/aerc.1.scd
+++ b/doc/aerc.1.scd
@@ -6,37 +6,42 @@ aerc - a pretty good email client.
# SYNOPSIS
-*aerc* [*-h*] [*-v*] [*-a* _<account>_] [*mailto:*_..._ | *:*_<command...>_ | *mbox:*_<file>_]
+*aerc* [*-h*] [*-v*] [*-a* _<name>_] [*-C* _<file>_] [*-A* _<file>_] [*-B*
+_<file>_] [*-I*] [*mailto:*_<...>_ | *mbox:*_<file>_ | :_<command...>_]
For a guided tutorial, use *:help tutorial* from aerc, or *man aerc-tutorial*
from your terminal.
# OPTIONS
-*-h*
+*-h*, *--help*
Show aerc usage help and exit.
-*-v*
+*-v*, *--version*
Print the installed version of aerc and exit.
-*-a* _<account>_
+*-a* _<name>_++
+*--account* _<name>_
Load only the named account, as opposed to all configured accounts. It
can also be a comma separated list of names. This option may be
specified multiple times. The account order will be preserved.
+*-C* _</path/to/aerc.conf>_++
*--aerc-conf* _</path/to/aerc.conf>_
Instead of using _$XDG_CONFIG_HOME/aerc/aerc.conf_ use the file at the
specified path for configuring aerc.
+*-A* _</path/to/accounts.conf>_++
*--accounts-conf* _</path/to/accounts.conf>_
Instead of using _$XDG_CONFIG_HOME/aerc/accounts.conf_ use the file at the
specified path for configuring accounts.
+*-B* _</path/to/binds.conf>_++
*--binds-conf* _</path/to/binds.conf>_
Instead of using _$XDG_CONFIG_HOME/aerc/binds.conf_ use the file at the
specified path for configuring binds.
-*--no-ipc*
+*-I*, *--no-ipc*
Run commands (*mailto:*_..._, *:*_<command...>_, *mbox:*_<file>_) directly
in this instance rather than over IPC in an existing aerc instance. Also
disable creation of an IPC server for subsequent aerc instances to
diff --git a/main.go b/main.go
index 40ce3cb8..123d360d 100644
--- a/main.go
+++ b/main.go
@@ -96,13 +96,13 @@ func buildInfo() string {
}
type Opts struct {
- Help bool `opt:"-h" action:"ShowHelp"`
- Version bool `opt:"-v" action:"ShowVersion"`
- Accounts []string `opt:"-a" action:"ParseAccounts" metavar:"<account>"`
- ConfAerc string `opt:"--aerc-conf"`
- ConfAccounts string `opt:"--accounts-conf"`
- ConfBinds string `opt:"--binds-conf"`
- NoIPC bool `opt:"--no-ipc"`
+ Help bool `opt:"-h,--help" action:"ShowHelp"`
+ Version bool `opt:"-v,--version" action:"ShowVersion"`
+ Accounts []string `opt:"-a,--account" action:"ParseAccounts" metavar:"<name>"`
+ ConfAerc string `opt:"-C,--aerc-conf" metavar:"<file>"`
+ ConfAccounts string `opt:"-A,--accounts-conf" metavar:"<file>"`
+ ConfBinds string `opt:"-B,--binds-conf" metavar:"<file>"`
+ NoIPC bool `opt:"-I,--no-ipc"`
Command []string `opt:"..." required:"false" metavar:"mailto:<address> | mbox:<file> | :<command...>"`
}
@@ -113,16 +113,20 @@ Aerc is an email client for your terminal.
Options:
- -h Show this help message and exit.
- -v Print version information.
- -a <account> Load only the named account, as opposed to all configured
+ -h, --help Show this help message and exit.
+ -v, --version Print version information.
+ -a <name>, --account <name>
+ Load only the named account, as opposed to all configured
accounts. It can also be a comma separated list of names.
This option may be specified multiple times. The account
order will be preserved.
- --aerc-conf Path to configuration file to be used instead of the default.
- --accounts-conf Path to configuration file to be used instead of the default.
- --binds-conf Path to configuration file to be used instead of the default.
- --no-ipc Run any commands in this aerc instance, and don't create a
+ -C <file>, --aerc-conf <file>
+ Path to configuration file to be used instead of the default.
+ -A <file>, --accounts-conf <file>
+ Path to configuration file to be used instead of the default.
+ -B <file>, --binds-conf <file>
+ Path to configuration file to be used instead of the default.
+ -I, --no-ipc Run any commands in this aerc instance, and don't create a
socket for other aerc instances to communicate with this one.
mailto:<address> Open the composer with the address(es) in the To field.
If aerc is already running, the composer is started in