WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

[Xen-API] [PATCH] Deleted parse_commandline and renamed parse_commandlin

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH] Deleted parse_commandline and renamed parse_commandline_2 to parse_commandline
From: Mike McClurg <mike.mcclurg@xxxxxxxxxx>
Date: Wed, 13 Oct 2010 17:58:40 +0100
Delivery-date: Wed, 20 Oct 2010 08:26:43 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.4.3
 ocaml/xapi/cli_frontend.ml |  5 +----
 ocaml/xapi/xapi_cli.ml     |  2 +-
 ocaml/xe-cli/cli.ml        |  8 +++++---
 3 files changed, 7 insertions(+), 8 deletions(-)


# HG changeset patch
# User Mike McClurg <mike.mcclurg@xxxxxxxxxx>
# Date 1286985041 -3600
# Node ID 4a03e0233c3540ef703463bf422e766d3f352e08
# Parent  8ca7127d9f3909ed9459ed49e0cc6dbff3171afd
Deleted parse_commandline and renamed parse_commandline_2 to parse_commandline.

parse_commandline was only used for compat-mode, which we just removed.

Signed-off-by: Mike McClurg <mike.mcclurg@xxxxxxxxxx>

diff --git a/ocaml/xapi/cli_frontend.ml b/ocaml/xapi/cli_frontend.ml
--- a/ocaml/xapi/cli_frontend.ml
+++ b/ocaml/xapi/cli_frontend.ml
@@ -2423,9 +2423,6 @@
         params = (parse_params ts) }
     | _ -> raise (ParseError ("No arguments given"))
 
-let parse_commandline arg_array =
-  parse (tokens_of_argv arg_array)
-
 let rec parse_params_2 xs =
   match xs with
       p::ps ->
@@ -2448,7 +2445,7 @@
          end
     | [] -> []
 
-let parse_commandline_2 arg_list =
+let parse_commandline arg_list =
   try
     let argv0 = List.hd arg_list in
     let cmdname = List.hd (List.tl arg_list) in
diff --git a/ocaml/xapi/xapi_cli.ml b/ocaml/xapi/xapi_cli.ml
--- a/ocaml/xapi/xapi_cli.ml
+++ b/ocaml/xapi/xapi_cli.ml
@@ -204,7 +204,7 @@
                        then (Some (Ref.of_string (String.sub line 11 
(String.length line - 11))), List.tl args)
                        else (None,args)
                with _ -> (None,args) in
-       let cmd = parse_commandline_2 ("xe"::args) in
+       let cmd = parse_commandline ("xe"::args) in
        ignore(exec_command req cmd s session args)
 
 let exception_handler s e =
diff --git a/ocaml/xe-cli/cli.ml b/ocaml/xe-cli/cli.ml
--- a/ocaml/xe-cli/cli.ml
+++ b/ocaml/xe-cli/cli.ml
@@ -119,9 +119,11 @@
   exit exit_error)
 
 let main() =
-(*  try*)
-    let cmd = Cli_frontend.parse_commandline (Array.to_list Sys.argv) in
-    exec_command cmd
+       (* try*)
+       let parse_commandline arg_array =
+               parse (tokens_of_argv arg_array) in
+       let cmd = parse_commandline (Array.to_list Sys.argv) in
+       exec_command cmd
 (*  with
       Cli_frontend.ParseError s ->
        param_error "Syntax error" s;
_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-API] [PATCH] Deleted parse_commandline and renamed parse_commandline_2 to parse_commandline, Mike McClurg <=