Skip to content

Commit 0c54c3c

Browse files
authored
floogen: add --version flag (#189)
1 parent f4a196e commit 0c54c3c

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [Unreleased]
8+
9+
### Added
10+
11+
#### FlooGen
12+
13+
- Add `--version` flag to the CLI to print the installed _FlooGen_ version
14+
715
## [0.8.2] - 2026-06-08
816

917
### Fixed

floogen/cli.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import argparse
99
from pathlib import Path
1010
from importlib.resources import files
11+
from importlib.metadata import version
1112

1213
from mako.template import Template
1314

@@ -93,6 +94,11 @@ def build_parser() -> argparse.ArgumentParser:
9394
description="FlooGen: A Network-on-Chip Generator for FlooNoC",
9495
add_help=True,
9596
)
97+
parser.add_argument(
98+
"--version",
99+
action="version",
100+
version=f"%(prog)s {version('floogen')}",
101+
)
96102

97103
subparsers = parser.add_subparsers(dest="command")
98104

0 commit comments

Comments
 (0)