New option -rollback_end

This commit is contained in:
2008-01-25 15:09:53 +00:00
parent 94ec5877ee
commit 19a7488ed6
4 changed files with 23 additions and 5 deletions

View File

@@ -6741,14 +6741,19 @@ int Xorriso_option_eject(struct XorrisO *xorriso, char *which, int flag)
/* Option -end */
/* @param flag bit0= discard pending changes */
int Xorriso_option_end(struct XorrisO *xorriso, int flag)
{
int ret;
if(xorriso->volset_change_pending) {
ret= Xorriso_option_commit(xorriso, 1);
if(ret<=0)
return(ret);
if(flag&1) {
xorriso->volset_change_pending= 0;
} else {
ret= Xorriso_option_commit(xorriso, 1);
if(ret<=0)
return(ret);
}
}
ret= Xorriso_give_up_drive(xorriso, 3);
if(ret<=0)
@@ -7293,7 +7298,9 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" # any text Is ignored. In dialog mode the input line will be stored in",
" the eventual readline history, nevertheless.",
" -version Tell program and version number",
" -end End program immediately",
" -end End program. Commit eventual pending changes.",
" -rollback_end",
" End program. Discard pending changes.",
"",
"",
"Option -page causes a user prompt after the given number of result lines.",
@@ -8620,6 +8627,13 @@ next_command:;
} else if(strcmp(cmd,"rollback")==0) {
ret= Xorriso_option_rollback(xorriso, 0);
} else if(strcmp(cmd,"rollback_end")==0) {
Xorriso_option_end(xorriso, 1);
ret= Xorriso_eval_problem_status(xorriso, ret, 0);
if(ret<0)
return(ret);
{ret= 3; goto ex;}
} else if(strcmp(cmd,"speed")==0) {
(*idx)++;
ret= Xorriso_option_speed(xorriso, arg1, 0);