]> sourceware.org Git - systemtap.git/commitdiff
modify interactive mode load behavior
authorFelix Lu <flu@redhat.com>
Tue, 23 Aug 2016 13:49:57 +0000 (09:49 -0400)
committerFelix Lu <flu@redhat.com>
Tue, 23 Aug 2016 13:52:19 +0000 (09:52 -0400)
The "load" command no longer appends to the existing script. The user
is prompted if they want to overwrite the existing file if the script is
not empty.

interactive.cxx

index 9bfe498f4b5e65d5f2c6c2cd97b514814041d84b..3a9a19d559dff26ade482b4817b3aa33220a796f 100644 (file)
@@ -660,6 +660,14 @@ public:
        return false;
       }
 
+    if (!script_vec.empty())
+      {
+        if (query("Script exists. Overwrite existing script? ", no_default))
+          script_vec.clear();
+        else
+          return false;
+      }
+
     // Originally, we called stap's parser here to read in the
     // script. However, doing so discards comments, preprocessor
     // directives, and rearranges the script. So, let's just read the
This page took 0.024836 seconds and 5 git commands to generate.