Project

General

Profile

Bug #22541

typos in help for release.py

Added by Dennis Box about 1 month ago. Updated about 11 hours ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Start date:
05/08/2019
Due date:
% Done:

0%

Estimated time:
First Occurred:
Occurs In:
Stakeholders:
Duration:

Description

The help lists both --version and --release-version as options, --version is a typo

mac-128665:ReleaseManager dbox$ ./release.py --help
release.py <version> <SourceDir> <ReleaseDir>
Example: Release Candidate rc3 for v3.2.11 (ie version v3_2_11_rc3)
Generate tarball: glideinWMS_v3_2_11_rc3*.tgz
Generate rpms : glideinWMS-*-v3.2.11-0.4.rc3-*.rpm
release.py --version=3_2_11 --rc=4 --source-dir=/home/parag/glideinwms --release-dir=/var/tmp/release --rpm-release=4 --rpm-version=3.2.11

Example: Final Release v3.2.11
Generate tarball: glideinWMS_v3_2_11*.tgz
Generate rpms : glideinWMS-*-v3.2.11-3-*.rpm
release.py --version=3_2_11 --source-dir=/home/parag/glideinwms --release-dir=/var/tmp/release --rpm-release=3 --rpm-version=3.2.11

ERROR: Insufficient arguments specified
Usage: release.py [options]

Options:
--version show program's version number and exit
-h, --help show this help message and exit
--release-version=<release version>
glideinwms version to release
--source-dir=<source directory>
directory containing the glideinwms source code
--release-dir=<release directory>
directory to store release tarballs and webpages
--rc=<Release Candidate Number>
Release Candidate
--rpm-release=<RPM Release Number>
RPM Release Number
--rpm-version=<Product Version in RPM filename>
Product Version in RPM filename

History

#1 Updated by Dennis Box about 1 month ago

  • Assignee changed from Dennis Box to Marco Mambelli
  • Status changed from New to Feedback

changed help output of release.py to conform to actual arguments set up by optparse

#2 Updated by Marco Mambelli about 1 month ago

  • Assignee changed from Marco Mambelli to Dennis Box

Changes are OK, but add also these 3 fixes:

Since you are at it:
1. no file for output

        parser.print_help(file)
-->
        parser.print_help()

2. Usage should return a string:
def usage():
print("%s <version> <SourceDir> <ReleaseDir>" % os.path.basename(sys.argv0))
print("Example: Release Candidate rc3 for v3.2.11 (ie version v3_2_11_rc3)")
print(" Generate tarball: glideinWMS_v3_2_11_rc3*.tgz")
print(" Generate rpms : glideinWMS-*-v3.2.11-0.4.rc3-*.rpm")
print("release.py --version=3_2_11 --rc=4 --source-dir=/home/parag/glideinwms --release-dir=/var/tmp/release --rpm-release=4 --rpm-version=3.2.11")
print("")
print("Example: Final Release v3.2.11")
print(" Generate tarball: glideinWMS_v3_2_11*.tgz")
print(" Generate rpms : glideinWMS-*-v3.2.11-3-*.rpm")
print("release.py --version=3_2_11 --source-dir=/home/parag/glideinwms --release-dir=/var/tmp/release --rpm-release=3 --rpm-version=3.2.11")
print("")

3. --version is a std option that returns the option of the program (show program's version number and exit). This is prevented here:

     if len(argv) < 4:
        print("ERROR: Insufficient arguments specified")
        parser.print_help()
        sys.exit(1)
--> add somthing like 
    if len(argv) == 1 and argv[0] in ['-v', '--version']:
        parser.print_version()        
        sys.exit()
    if len(argv) < 4:
        print("ERROR: Insufficient arguments specified")
        parser.print_help()
        sys.exit(1)

#3 Updated by Dennis Box about 1 month ago

  • Status changed from Feedback to Resolved

merged to master after feedback changes

#4 Updated by Marco Mambelli about 11 hours ago

  • Status changed from Resolved to Closed


Also available in: Atom PDF