added "isabelle phabricator";
authorwenzelm
Mon, 11 Nov 2019 11:49:43 +0100
changeset 71097 d3ededaa77b3
parent 71094 a197532693a5
child 71098 da378866f580
added "isabelle phabricator";
src/Pure/System/isabelle_tool.scala
src/Pure/Tools/phabricator.scala
--- a/src/Pure/System/isabelle_tool.scala	Sat Nov 09 15:39:21 2019 +0000
+++ b/src/Pure/System/isabelle_tool.scala	Mon Nov 11 11:49:43 2019 +0100
@@ -153,6 +153,7 @@
   Options.isabelle_tool,
   Phabricator.isabelle_tool1,
   Phabricator.isabelle_tool2,
+  Phabricator.isabelle_tool3,
   Present.isabelle_tool,
   Profiling_Report.isabelle_tool,
   Server.isabelle_tool,
--- a/src/Pure/Tools/phabricator.scala	Sat Nov 09 15:39:21 2019 +0000
+++ b/src/Pure/Tools/phabricator.scala	Mon Nov 11 11:49:43 2019 +0100
@@ -98,6 +98,41 @@
 
 
 
+  /** command-line tools **/
+
+  /* Isabelle tool wrapper */
+
+  val isabelle_tool1 =
+    Isabelle_Tool("phabricator", "invoke command-line tool within Phabricator home directory", args =>
+    {
+      var name = default_name
+
+      val getopts =
+        Getopts("""
+Usage: isabelle phabricator [OPTIONS] COMMAND [ARGS...]
+
+  Options are:
+    -n NAME      Phabricator installation name (default: """ + quote(default_name) + """)
+
+  Invoke a command-line tool within the home directory of the named Phabricator
+  installation.
+""",
+          "n:" -> (arg => name = arg))
+
+      val more_args = getopts(args)
+      if (more_args.isEmpty) getopts.usage()
+
+      val progress = new Console_Progress
+
+      val config = get_config(name)
+
+      if (!progress.bash(Bash.strings(more_args), cwd = config.home.file, echo = true).ok) {
+        error("Command failed")
+      }
+    })
+
+
+
   /** setup **/
 
   def user_setup(name: String, description: String, ssh_setup: Boolean = false)
@@ -327,7 +362,7 @@
 
   /* Isabelle tool wrapper */
 
-  val isabelle_tool1 =
+  val isabelle_tool2 =
     Isabelle_Tool("phabricator_setup", "setup Phabricator server on Ubuntu Linux", args =>
     {
       var repo = ""
@@ -436,7 +471,7 @@
 
   /* Isabelle tool wrapper */
 
-  val isabelle_tool2 =
+  val isabelle_tool3 =
     Isabelle_Tool("phabricator_setup_mail",
       "setup mail configuration for existing Phabricator server", args =>
     {