secflow-cli 0.2.0__py3-none-any.whl → 0.2.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
secflow_cli/main.py CHANGED
@@ -3,7 +3,6 @@ from __future__ import annotations
3
3
  import argparse
4
4
  from collections.abc import Mapping
5
5
  import getpass
6
- from importlib.metadata import PackageNotFoundError, version as distribution_version
7
6
  import json
8
7
  import math
9
8
  import os
@@ -33,13 +32,22 @@ class Parser(argparse.ArgumentParser):
33
32
  raise CliError(2, "INVALID_INPUT", "Invalid or missing arguments. Use --help for command syntax.")
34
33
 
35
34
 
35
+ class VersionAction(argparse.Action):
36
+ """Reads package metadata only when --version is requested; the lookup slows every start."""
37
+
38
+ def __call__(self, parser, namespace, values, option_string=None):
39
+ from importlib.metadata import PackageNotFoundError, version
40
+ try:
41
+ current = version("secflow-cli")
42
+ except PackageNotFoundError:
43
+ current = "development"
44
+ print(f"secflowctl {current}")
45
+ parser.exit()
46
+
47
+
36
48
  def parser():
37
49
  result = Parser(prog="secflowctl", description="SecFlow operator CLI (independent of the service CLI).")
38
- try:
39
- version = distribution_version("secflow-cli")
40
- except PackageNotFoundError:
41
- version = "development"
42
- result.add_argument("--version", action="version", version=f"secflowctl {version}")
50
+ result.add_argument("--version", action=VersionAction, nargs=0, help="Show the CLI version and exit.")
43
51
  result.add_argument("--profile")
44
52
  result.add_argument("--base-url")
45
53
  result.add_argument("--output", choices=("table", "json", "jsonl"))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: secflow-cli
3
- Version: 0.2.0
3
+ Version: 0.2.2
4
4
  Summary: SecFlow operator CLI
5
5
  License-Expression: MIT
6
6
  Project-URL: Repository, https://github.com/yeon3724/secflow
@@ -10,7 +10,7 @@ secflow_cli/credentials.py,sha256=1mPwqDOySuFFZ7GwKGx4zn7VtgM31B9T2m92gRiF8-s,24
10
10
  secflow_cli/doctor_commands.py,sha256=Ywn1-WhjgyqOY4DmWbo48KdgYuT475F7IPFGubs4UFg,4312
11
11
  secflow_cli/errors.py,sha256=x_HkTDvn0rPVXrPmfCDJG7_VB3KFL6imosKj_A8toec,287
12
12
  secflow_cli/help.py,sha256=xal_b3q29ca7jYJwP9oTnS2rlePtVrmlhF75TZDfVDc,13967
13
- secflow_cli/main.py,sha256=2Xoad1U37LwreF-snlzoMEy_hiPidorjPhH9WpPQEp0,28424
13
+ secflow_cli/main.py,sha256=yW1iFaI_D1YZfgtbaZhhRuj8T9jwPSY2yIlZGMHamew,28700
14
14
  secflow_cli/manifest_commands.py,sha256=0qGhC0Yw0OuYRygbP3YIJfQYzGlj_aLw6Slbp0kCrMI,15008
15
15
  secflow_cli/namespace_commands.py,sha256=sPYvEAicVgwk8eFSy3OB33Hsk8dPoSMjZpIYIsou5xk,7894
16
16
  secflow_cli/operator_commands.py,sha256=54A6goR_xqXKR-uvU6WFNFrNPgUyUHagz8ZBwpUMljw,19082
@@ -22,9 +22,9 @@ secflow_cli/runtime_commands.py,sha256=2bQwxm60x2UvhSZ1tGTWrh9-N6HRtLBi4oid_zyjz
22
22
  secflow_cli/secret_commands.py,sha256=AijA1_05dTfZ54anKZYcOJKdUcRwqDV7aXSgZlrlTlk,6904
23
23
  secflow_cli/session_commands.py,sha256=n0SfKkm7Pgs7vImgLagNYV6nGAe55iVxCtrP9oco9E4,4981
24
24
  secflow_cli/token_commands.py,sha256=VKeT0RBRtviiSnneWop27ZEEDb2MkSnsQ0MZv2_lHgc,4990
25
- secflow_cli-0.2.0.dist-info/licenses/LICENSE,sha256=lkuZDJi4eOjp7xU3_ZedIoj4bUrzCeO5wL-luDMbtoU,1077
26
- secflow_cli-0.2.0.dist-info/METADATA,sha256=5GhEvuc0oDB8leGxHvBiuFuig4_uGO3mJTN2jncN_Ec,10367
27
- secflow_cli-0.2.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
28
- secflow_cli-0.2.0.dist-info/entry_points.txt,sha256=bcAY5pq49bMl6YGgs1KwCwjmZ4IRTu7qwWU8s2hQPgQ,53
29
- secflow_cli-0.2.0.dist-info/top_level.txt,sha256=bt8cA4MqXlcILjjDwN0sIKThGWvyd2v8NN2wZnQX_6w,12
30
- secflow_cli-0.2.0.dist-info/RECORD,,
25
+ secflow_cli-0.2.2.dist-info/licenses/LICENSE,sha256=lkuZDJi4eOjp7xU3_ZedIoj4bUrzCeO5wL-luDMbtoU,1077
26
+ secflow_cli-0.2.2.dist-info/METADATA,sha256=KDc6euIZJmUznRgFLGlofIqLjpr4yTRHU1YLm3-8Na0,10367
27
+ secflow_cli-0.2.2.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
28
+ secflow_cli-0.2.2.dist-info/entry_points.txt,sha256=bcAY5pq49bMl6YGgs1KwCwjmZ4IRTu7qwWU8s2hQPgQ,53
29
+ secflow_cli-0.2.2.dist-info/top_level.txt,sha256=bt8cA4MqXlcILjjDwN0sIKThGWvyd2v8NN2wZnQX_6w,12
30
+ secflow_cli-0.2.2.dist-info/RECORD,,