Skip to content

Commit 3bc187d

Browse files
committed
fuse_fs: Add --version flag and deduplicate banner string
Add a --version command line option that prints the version banner and exits. Consolidate the banner string into a single __banner__ variable so the copyright notice is defined in one place rather than three. Update copyright year to 2025-2026.
1 parent 8ac9e0e commit 3bc187d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

amifuse/fuse_fs.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2050,7 +2050,7 @@ def mount_fuse(
20502050
mountpoint.mkdir(parents=True)
20512051

20522052
# Print startup banner
2053-
print(f"amifuse {__version__} - Copyright (C) 2025 by Stefan Reinauer")
2053+
print(__banner__)
20542054
if adf_info is not None:
20552055
floppy_type = "HD" if adf_info.is_hd else "DD"
20562056
print(f"Mounting ADF floppy ({floppy_type}) from {image}")
@@ -2127,6 +2127,7 @@ def _unmount_mountpoint():
21272127

21282128

21292129
__version__ = "v0.2.0"
2130+
__banner__ = f"amifuse {__version__} - Copyright (C) 2025-2026 by Stefan Reinauer"
21302131

21312132

21322133
def _inspect_rdisk(rdisk, full=False):
@@ -2249,10 +2250,15 @@ def cmd_mount(args):
22492250

22502251
def main(argv=None):
22512252
parser = argparse.ArgumentParser(
2252-
description=f"amifuse {__version__} - Copyright (C) 2025 by Stefan Reinauer\n\n"
2253+
description=f"{__banner__}\n\n"
22532254
"Mount Amiga filesystem images via FUSE.",
22542255
formatter_class=argparse.RawDescriptionHelpFormatter,
22552256
)
2257+
parser.add_argument(
2258+
"--version",
2259+
action="version",
2260+
version=__banner__,
2261+
)
22562262
subparsers = parser.add_subparsers(dest="command", required=True)
22572263

22582264
# inspect subcommand

0 commit comments

Comments
 (0)