diff --git a/src/commands.cc b/src/commands.cc index 7ef9deac..a9faedb4 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -460,11 +460,19 @@ const CommandDesc force_edit_cmd = { edit }; -const ParameterDesc write_params{ +const ParameterDesc write_params = { + { + { "sync", { false, "force the synchronization of the file onto the filesystem" } }, + { "method", { true, "explicit writemethod (replace|overwrite)" } }, + { "force", { false, "Allow overwriting existing file with explicit filename" } } + }, + ParameterDesc::Flags::SwitchesOnlyAtStart, 0, 1 +}; + +const ParameterDesc write_params_except_force = { { { "sync", { false, "force the synchronization of the file onto the filesystem" } }, { "method", { true, "explicit writemethod (replace|overwrite)" } }, - { "force", { false, "Allow overwriting existing file with explicit filename" } }, }, ParameterDesc::Flags::SwitchesOnlyAtStart, 0, 1 }; @@ -533,7 +541,7 @@ const CommandDesc force_write_cmd = { "w!", "write! [] []: write the current buffer to its file " "or to if specified, even when the file is write protected", - write_params, + write_params_except_force, CommandFlags::None, CommandHelper{}, filename_completer, @@ -568,7 +576,7 @@ const CommandDesc write_all_cmd = { "wa", "write-all []: write all changed buffers that are associated to a file", ParameterDesc{ - write_params.switches, + write_params_except_force.switches, ParameterDesc::Flags::None, 0, 0 }, CommandFlags::None, @@ -693,9 +701,9 @@ void write_quit(const ParametersParser& parser, Context& context, const CommandDesc write_quit_cmd = { "write-quit", "wq", - "write-quit [-sync] []: write current buffer and quit current client. " + "write-quit [] []: write current buffer and quit current client. " "An optional integer parameter can set the client exit status", - write_params, + write_params_except_force, CommandFlags::None, CommandHelper{}, CommandCompleter{}, @@ -705,9 +713,9 @@ const CommandDesc write_quit_cmd = { const CommandDesc force_write_quit_cmd = { "write-quit!", "wq!", - "write-quit! [-sync] [] write: current buffer and quit current client, even if other buffers are not saved. " + "write-quit! [] [] write: current buffer and quit current client, even if other buffers are not saved. " "An optional integer parameter can set the client exit status", - write_params, + write_params_except_force, CommandFlags::None, CommandHelper{}, CommandCompleter{}, @@ -717,9 +725,9 @@ const CommandDesc force_write_quit_cmd = { const CommandDesc write_all_quit_cmd = { "write-all-quit", "waq", - "write-all-quit [-sync] []: write all buffers associated to a file and quit current client. " + "write-all-quit [] []: write all buffers associated to a file and quit current client. " "An optional integer parameter can set the client exit status.", - write_params, + write_params_except_force, CommandFlags::None, CommandHelper{}, CommandCompleter{},