kitecmd 0.1__tar.gz → 0.2__tar.gz
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.
- {kitecmd-0.1 → kitecmd-0.2}/PKG-INFO +1 -1
- kitecmd-0.2/kitecmd/__init__.py +11 -0
- kitecmd-0.2/kitecmd/__main__.py +4 -0
- kitecmd-0.2/kitecmd/cli.py +31 -0
- {kitecmd-0.1 → kitecmd-0.2}/kitecmd.egg-info/PKG-INFO +1 -1
- {kitecmd-0.1 → kitecmd-0.2}/kitecmd.egg-info/SOURCES.txt +3 -0
- kitecmd-0.2/kitecmd.egg-info/top_level.txt +1 -0
- {kitecmd-0.1 → kitecmd-0.2}/setup.py +1 -1
- kitecmd-0.1/kitecmd.egg-info/top_level.txt +0 -1
- {kitecmd-0.1 → kitecmd-0.2}/README.md +0 -0
- {kitecmd-0.1 → kitecmd-0.2}/kitecmd.egg-info/dependency_links.txt +0 -0
- {kitecmd-0.1 → kitecmd-0.2}/kitecmd.egg-info/entry_points.txt +0 -0
- {kitecmd-0.1 → kitecmd-0.2}/pyproject.toml +0 -0
- {kitecmd-0.1 → kitecmd-0.2}/setup.cfg +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
|
|
3
|
+
def main():
|
|
4
|
+
parser = argparse.ArgumentParser(
|
|
5
|
+
prog="kitecmd",
|
|
6
|
+
description="Kite Command Utility - Example CLI for PyPI"
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
subparsers = parser.add_subparsers(dest="command", help="Available commands")
|
|
10
|
+
|
|
11
|
+
# Example: 'kitecmd hello'
|
|
12
|
+
hello_parser = subparsers.add_parser("hello", help="Print a greeting")
|
|
13
|
+
hello_parser.add_argument("--name", "-n", default="World", help="Who to greet")
|
|
14
|
+
|
|
15
|
+
# Example: 'kitecmd add'
|
|
16
|
+
add_parser = subparsers.add_parser("add", help="Add two numbers")
|
|
17
|
+
add_parser.add_argument("a", type=float, help="First number")
|
|
18
|
+
add_parser.add_argument("b", type=float, help="Second number")
|
|
19
|
+
|
|
20
|
+
args = parser.parse_args()
|
|
21
|
+
|
|
22
|
+
if args.command == "hello":
|
|
23
|
+
print(f"Hello, {args.name}!")
|
|
24
|
+
elif args.command == "add":
|
|
25
|
+
print(f"Result: {args.a + args.b}")
|
|
26
|
+
else:
|
|
27
|
+
parser.print_help()
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
if __name__ == "__main__":
|
|
31
|
+
main()
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
kitecmd
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|