* mu-cmd.c: support target-less moving (i.e.. flag setting)
This commit is contained in:
16
src/mu-cmd.c
16
src/mu-cmd.c
@ -286,8 +286,8 @@ static gboolean
|
|||||||
mv_check_params (MuConfig *opts, MuFlags *flags)
|
mv_check_params (MuConfig *opts, MuFlags *flags)
|
||||||
{
|
{
|
||||||
if (!opts->params[1] || !opts->params[2]) {
|
if (!opts->params[1] || !opts->params[2]) {
|
||||||
g_warning ("usage: mu mv [--flags=<flags>] <sourcefile> "
|
g_warning ("usage: mu mv [--flags=<flags>] <mailfile> "
|
||||||
"<targetmaildir>");
|
"<maildir>");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -295,8 +295,9 @@ mv_check_params (MuConfig *opts, MuFlags *flags)
|
|||||||
if (!opts->flagstr)
|
if (!opts->flagstr)
|
||||||
*flags = MU_FLAG_INVALID; /* ie., ignore flags */
|
*flags = MU_FLAG_INVALID; /* ie., ignore flags */
|
||||||
else
|
else
|
||||||
*flags = mu_flags_from_str (opts->flagstr, MU_FLAG_TYPE_ANY);
|
*flags = mu_flags_from_str (opts->flagstr,
|
||||||
|
MU_FLAG_TYPE_MAILDIR |
|
||||||
|
MU_FLAG_TYPE_MAILFILE);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -316,7 +317,6 @@ cmd_mv_dev_null (MuConfig *opts)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
MuError
|
MuError
|
||||||
mu_cmd_mv (MuConfig *opts)
|
mu_cmd_mv (MuConfig *opts)
|
||||||
{
|
{
|
||||||
@ -332,9 +332,9 @@ mu_cmd_mv (MuConfig *opts)
|
|||||||
return cmd_mv_dev_null (opts);
|
return cmd_mv_dev_null (opts);
|
||||||
|
|
||||||
err = NULL;
|
err = NULL;
|
||||||
fullpath = mu_msg_file_move_to_maildir (opts->params[1],
|
fullpath = mu_maildir_move_message (opts->params[1],
|
||||||
opts->params[2],
|
opts->params[2],
|
||||||
flags, &err);
|
flags, &err);
|
||||||
if (!fullpath) {
|
if (!fullpath) {
|
||||||
if (err) {
|
if (err) {
|
||||||
MuError code;
|
MuError code;
|
||||||
|
|||||||
Reference in New Issue
Block a user