Annotation of src/usr.bin/cvs/version.c, Revision 1.23
1.23 ! joris 1: /* $OpenBSD: version.c,v 1.22 2006/11/14 09:47:52 xsa Exp $ */
1.1 jfb 2: /*
3: * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
1.22 xsa 4: * Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org>
1.1 jfb 5: *
1.22 xsa 6: * Permission to use, copy, modify, and distribute this software for any
7: * purpose with or without fee is hereby granted, provided that the above
8: * copyright notice and this permission notice appear in all copies.
1.1 jfb 9: *
1.22 xsa 10: * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11: * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12: * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13: * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14: * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15: * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16: * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1.1 jfb 17: */
18:
1.19 xsa 19: #include "includes.h"
1.1 jfb 20:
21: #include "cvs.h"
1.13 jfb 22: #include "log.h"
1.22 xsa 23: #include "remote.h"
1.1 jfb 24:
1.11 jfb 25: struct cvs_cmd cvs_cmd_version = {
1.22 xsa 26: CVS_OP_VERSION, 0, "version",
1.11 jfb 27: { "ve", "ver" },
28: "Show current CVS version(s)",
29: "",
30: "",
31: NULL,
1.22 xsa 32: cvs_version
1.8 joris 33: };
1.1 jfb 34:
1.22 xsa 35: int
36: cvs_version(int argc, char **argv)
37: {
38: if (current_cvsroot != NULL &&
39: current_cvsroot->cr_method != CVS_METHOD_LOCAL)
40: cvs_printf("Client: ");
1.13 jfb 41:
1.12 joris 42: cvs_printf("%s\n", CVS_VERSION);
1.1 jfb 43:
1.22 xsa 44: if (current_cvsroot != NULL &&
45: current_cvsroot->cr_method != CVS_METHOD_LOCAL) {
1.23 ! joris 46: cvs_client_connect_to_server();
1.22 xsa 47: cvs_client_send_request("version");
48: /* XXX: better way to handle server response? */
49: cvs_printf("Server: ");
50: cvs_client_get_responses();
1.1 jfb 51: }
52:
53: return (0);
54: }