mirror of https://github.com/wanadev/yoga.git
CLI: Add a --version option to display the YOGA's version
This commit is contained in:
parent
0fb70bdc3a
commit
3a31472120
|
@ -64,6 +64,7 @@ Changelog
|
|||
* JPEG optimization has been improved by using some optimizations from
|
||||
MozJPEG after the Guetzli encoding (from 2.4 % to 7.3 % of additional size
|
||||
reduction)
|
||||
* CLI: add a ``--version`` option to get YOGA's version
|
||||
* **For packagers:**
|
||||
|
||||
* new dependency to `mozjpeg-lossless-optimization
|
||||
|
|
|
@ -12,6 +12,7 @@ Command Line Interface
|
|||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
--version show program's version number and exit
|
||||
|
||||
|
||||
The YOGA command line interface is divided in two sub-commands:
|
||||
|
|
|
@ -4,6 +4,7 @@ from functools import partial
|
|||
|
||||
from .image.cli import add_image_cli_options
|
||||
from .model.cli import add_model_cli_options
|
||||
from .version import VERSION
|
||||
|
||||
|
||||
def _type_path(mode, string):
|
||||
|
@ -71,6 +72,12 @@ def generate_main_cli():
|
|||
prog="yoga",
|
||||
usage="%(prog)s [-h] {image,model} [options...] input output",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--version",
|
||||
action="version",
|
||||
version="%%(prog)s %s" % VERSION,
|
||||
)
|
||||
|
||||
subparsers = parser.add_subparsers(dest="subcommand")
|
||||
|
||||
image_parser = subparsers.add_parser(
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
VERSION = "1.0.0"
|
Loading…
Reference in New Issue