Skip to content

Commit dc038fd

Browse files
committed
Add pn CLI
1 parent 084ad3d commit dc038fd

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

libs/pythonnative/cli/__init__.py

Whitespace-only changes.

libs/pythonnative/cli/pn.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import argparse
2+
3+
4+
def init_project(args):
5+
"""
6+
Initialize a new PythonNative project.
7+
"""
8+
# TODO: Implementation
9+
10+
11+
def run_project(args):
12+
"""
13+
Run the specified project.
14+
"""
15+
# TODO: Implementation
16+
17+
18+
def clean_project(args):
19+
"""
20+
Clean the specified project.
21+
"""
22+
# TODO: Implementation
23+
24+
25+
def main():
26+
parser = argparse.ArgumentParser(prog="pn", description="PythonNative CLI")
27+
subparsers = parser.add_subparsers()
28+
29+
# Create a new command 'init' that calls init_project
30+
parser_init = subparsers.add_parser("init")
31+
parser_init.set_defaults(func=init_project)
32+
33+
# Create a new command 'run' that calls run_project
34+
parser_run = subparsers.add_parser("run")
35+
parser_run.add_argument("platform", choices=["android", "ios"])
36+
parser_run.set_defaults(func=run_project)
37+
38+
# Create a new command 'clean' that calls clean_project
39+
parser_clean = subparsers.add_parser("clean")
40+
parser_clean.set_defaults(func=clean_project)
41+
42+
args = parser.parse_args()
43+
args.func(args)

libs/pythonnative/setup.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,9 @@
2020
"rubicon-objc>=0.4.6,<0.5.0",
2121
# Add more requirements here as necessary
2222
],
23+
entry_points={
24+
"console_scripts": [
25+
"pn=cli.pn:main",
26+
],
27+
},
2328
)

0 commit comments

Comments
 (0)