various adjustments so that a MidiPlaylist gets re-rendered whenever it changes.
[ardour.git] / session_utils / export.cc
index 76b54741563dbd10e5ccfe26428d12f4f2428cf5..3bffc07f0e0d425ad9f9ecbfa1cdc2273c220c67 100644 (file)
@@ -37,6 +37,8 @@
 #include "ardour/session_metadata.h"
 #include "ardour/broadcast_info.h"
 
+#include "pbd/i18n.h"
+
 using namespace std;
 using namespace ARDOUR;
 using namespace SessionUtils;
@@ -201,13 +203,13 @@ static int export_session (Session *session,
        }
        printf("\n");
 
-       status->finish ();
+       status->finish (TRS_UI);
 
        printf ("* Done.\n");
        return 0;
 }
 
-static void usage (int status) {
+static void usage () {
        // help2man compatible format (standard GNU help-text)
        printf (UTILNAME " - export an ardour session from the commandline.\n\n");
        printf ("Usage: " UTILNAME " [ OPTIONS ] <session-dir> <session/snapshot-name>\n\n");
@@ -231,7 +233,7 @@ Note: the tool expects a session-name without .ardour file-name extension.\n\
 
        printf ("Report bugs to <http://tracker.ardour.org/>\n"
                "Website: <http://ardour.org/>\n");
-       ::exit (status);
+       ::exit (EXIT_SUCCESS);
 }
 
 int main (int argc, char* argv[])
@@ -272,7 +274,7 @@ int main (int argc, char* argv[])
                                                        settings._sample_format = ExportFormatBase::SF_Float;
                                                        break;
                                                }
-                                               /* fall through */
+                                               /* fallthrough */
                                        default:
                                                fprintf(stderr, "Invalid Bit Depth\n");
                                                break;
@@ -309,17 +311,19 @@ int main (int argc, char* argv[])
                                break;
 
                        case 'h':
-                               usage (EXIT_SUCCESS);
+                               usage ();
                                break;
 
                        default:
-                                       usage (EXIT_FAILURE);
-                                       break;
+                               cerr << "Error: unrecognized option. See --help for usage information.\n";
+                               ::exit (EXIT_FAILURE);
+                               break;
                }
        }
 
        if (optind + 2 > argc) {
-               usage (EXIT_FAILURE);
+               cerr << "Error: Missing parameter. See --help for usage information.\n";
+               ::exit (EXIT_FAILURE);
        }
 
        SessionUtils::init(false);