diff options
| author | Johannes Altmanninger <aclopte@gmail.com> | 2022-08-01 11:36:22 +0200 |
|---|---|---|
| committer | Johannes Altmanninger <aclopte@gmail.com> | 2022-08-28 09:28:06 +0200 |
| commit | 7ae31b6778fdf8129f4ccc0045e27c8389e53e18 (patch) | |
| tree | 61911b96ab17d5347da3e0f803646b86e847b176 /src/shared_string.cc | |
| parent | 348b3f9d9d2a72017a320283698e8e06d3712aea (diff) | |
Show write -force parameter only for commands that support it
When passing a filename parameter to "write", the -force parameter
allows overwriting an existing file.
The "write!" variant (which allows writing files where the current
user does not have write permissions) already implies -force.
All other variants (like write-quit or write-all) do not take a
file parameter.
Hence -force is relevant only for "write". Let's hide it from the
autoinfo of the other commands.
It's difficult to avoid duplication when constructing the constexpr
SwitchMap because String is not constexpr-enabled. Today, all our
SwitchMap objects are known at compile time, so we could make SwitchMap
use StringView to work around this. In future we might want to allow
adding switches at runtime, which would need String again to avoid
lifetime issues.
Diffstat (limited to 'src/shared_string.cc')
0 files changed, 0 insertions, 0 deletions
