diff options
author | bertagaz <bertagaz@ptitcanardnoir.org> | 2011-06-14 15:26:19 +0200 |
---|---|---|
committer | bertagaz <bertagaz@ptitcanardnoir.org> | 2011-06-14 15:26:19 +0200 |
commit | 30e9097985656920f01a72efc1088caa2b8d41b3 (patch) | |
tree | bedbdb1aaa484af467e538110ab4c0c95985b6b8 /darcsver-1.6.3.egg/scripts |
Imported Upstream version 0.5.29upstream/0.5.29
Diffstat (limited to 'darcsver-1.6.3.egg/scripts')
-rw-r--r-- | darcsver-1.6.3.egg/scripts/__init__.py | 0 | ||||
-rw-r--r-- | darcsver-1.6.3.egg/scripts/darcsverscript.py | 46 |
2 files changed, 46 insertions, 0 deletions
diff --git a/darcsver-1.6.3.egg/scripts/__init__.py b/darcsver-1.6.3.egg/scripts/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/darcsver-1.6.3.egg/scripts/__init__.py diff --git a/darcsver-1.6.3.egg/scripts/darcsverscript.py b/darcsver-1.6.3.egg/scripts/darcsverscript.py new file mode 100644 index 0000000..7c54f53 --- /dev/null +++ b/darcsver-1.6.3.egg/scripts/darcsverscript.py @@ -0,0 +1,46 @@ +#! /usr/bin/env python + +from optparse import OptionParser +import os, sys + +from darcsver import darcsvermodule, __version__ + +try: + EXE_NAME=os.path.basename(sys.argv[0]) +except: + EXE_NAME="darcsver" + +def main(): + parser = OptionParser(usage="Usage: %prog [options] [pkgname [verfilename]]", + version="%prog " + str(__version__), + prog=EXE_NAME) + parser.add_option("-q", "--quiet", default=False, action="store_true", + help="Be quiet, do the job without any output.") + parser.add_option("--count-all-patches", "--revision-number", default=False, + action="store_true", dest="count_all_patches", + help="By default %s counts the number of patches since the " + "most recent release tag. With this option, it counts " + "all the patches in the repository." % EXE_NAME) + + options, args = parser.parse_args() + + if args: + pkgname = args.pop(0) + else: + pkgname = os.path.basename(os.getcwd()) + if not options.quiet: + print "%s: You didn't pass a pkg-name on the command-line, so I'm going to take the name of the current working directory: \"%s\"" % (EXE_NAME, pkgname,) + + if args: + verfilename = args.pop(0) + else: + verfilename = os.path.join(pkgname, "_version.py") + if not options.quiet: + print "%s: You didn't pass a verfilename on the command-line, so I'm going to build one from the name of the package: \"%s\"" % (EXE_NAME, verfilename,) + + (rc, newverstr) = darcsvermodule.update(pkgname=pkgname, verfilename=verfilename, revision_number=options.count_all_patches, quiet=options.quiet, EXE_NAME=EXE_NAME) + return rc + +if __name__ == "__main__": + rc = main() + sys.exit(rc) |