[BACK]Return to version.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / cvs

Annotation of src/usr.bin/cvs/version.c, Revision 1.26

1.26    ! joris       1: /*     $OpenBSD: version.c,v 1.25 2007/05/02 16:26:50 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:
                     19: #include "cvs.h"
1.22      xsa        20: #include "remote.h"
1.1       jfb        21:
1.11      jfb        22: struct cvs_cmd cvs_cmd_version = {
1.22      xsa        23:        CVS_OP_VERSION, 0, "version",
1.11      jfb        24:        { "ve", "ver" },
                     25:        "Show current CVS version(s)",
                     26:        "",
                     27:        "",
                     28:        NULL,
1.22      xsa        29:        cvs_version
1.8       joris      30: };
1.1       jfb        31:
1.22      xsa        32: int
                     33: cvs_version(int argc, char **argv)
                     34: {
1.25      xsa        35:        if (argc > 1)
                     36:                fatal("version does not take any extra arguments");
                     37:
1.26    ! joris      38:        if (current_cvsroot != NULL && cvsroot_is_remote())
1.22      xsa        39:                cvs_printf("Client: ");
1.13      jfb        40:
1.12      joris      41:        cvs_printf("%s\n", CVS_VERSION);
1.1       jfb        42:
1.26    ! joris      43:        if (current_cvsroot != NULL && cvsroot_is_remote()) {
1.23      joris      44:                cvs_client_connect_to_server();
1.22      xsa        45:                cvs_client_send_request("version");
                     46:                /* XXX: better way to handle server response? */
                     47:                cvs_printf("Server: ");
                     48:                cvs_client_get_responses();
1.1       jfb        49:        }
                     50:
                     51:        return (0);
                     52: }