Annotation of freem/scripts/fmd-versions, revision 1.2

1.1       snw         1: #!/usr/bin/env bash
                      2: 
                      3: #
1.2     ! snw         4: #   $Id: fmd-versions,v 1.1 2025/04/04 18:30:03 snw Exp $
1.1       snw         5: #    Gets the changelog for a specific version
                      6: #
                      7: #  
                      8: #   Author: Serena Willis <snw@coherent-logic.com>
                      9: #    Copyright (C) 2025 Coherent Logic Development LLC
                     10: #
                     11: #
                     12: #   This file is part of FreeM.
                     13: #
                     14: #   FreeM is free software: you can redistribute it and/or modify
                     15: #   it under the terms of the GNU Affero Public License as published by
                     16: #   the Free Software Foundation, either version 3 of the License, or
                     17: #   (at your option) any later version.
                     18: #
                     19: #   FreeM is distributed in the hope that it will be useful,
                     20: #   but WITHOUT ANY WARRANTY; without even the implied warranty of
                     21: #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                     22: #   GNU Affero Public License for more details.
                     23: #
                     24: #   You should have received a copy of the GNU Affero Public License
                     25: #   along with FreeM.  If not, see <https://www.gnu.org/licenses/>.
                     26: #
1.2     ! snw        27: #   $Log: fmd-versions,v $
        !            28: #   Revision 1.1  2025/04/04 18:30:03  snw
        !            29: #   Add fmd versions command to list all versions
        !            30: #
1.1       snw        31: #
                     32: #
                     33: # SPDX-FileCopyrightText:  (C) 2025 Coherent Logic Development LLC
                     34: # SPDX-License-Identifier: AGPL-3.0-or-later
                     35: #
                     36: 
                     37: function usage() {
1.2     ! snw        38:     echo
        !            39:     echo "Prints a list of all known FreeM versions"
        !            40:     echo    
        !            41:     echo "usage:  "
        !            42:     echo
        !            43:     echo "  fmd versions"
        !            44:     echo
        !            45:     exit 0
1.1       snw        46: }
                     47: 
1.2     ! snw        48: if [[ $1 == "help" ]]
        !            49: then
        !            50:     usage
        !            51: fi
        !            52: 
1.1       snw        53: if [[ $# == 0 ]]
                     54: then
                     55:     echo "versions:  must be run from 'fmd versions'"
                     56:     exit 1
                     57: fi
                     58: 
                     59: if [[ ! -f sem.ver ]]
                     60: then
                     61:     echo "Not in the root of the FreeM repository."
                     62:     exit 1
                     63: fi
                     64: 
                     65: FMD="$1"
                     66: 
                     67: cat ChangeLog | egrep "^VERSION" | cut -d" " -f2
                     68: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>