Skip to content

Commit 5ffd847

Browse files
committed
Properly merge upstream/dev
1 parent ab15e7a commit 5ffd847

2 files changed

Lines changed: 235 additions & 185 deletions

File tree

concore_cli/cli.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
import click
22
from rich.console import Console
3-
from rich.table import Table
4-
from rich.panel import Panel
5-
from rich import print as rprint
6-
import sys
73
import os
8-
from pathlib import Path
4+
import sys
95

106
from .commands.init import init_project
117
from .commands.run import run_workflow
128
from .commands.validate import validate_workflow
139
from .commands.status import show_status
1410
from .commands.stop import stop_all
11+
from .commands.inspect import inspect_workflow
1512

1613
console = Console()
14+
DEFAULT_EXEC_TYPE = 'windows' if os.name == 'nt' else 'posix'
1715

1816
@click.group()
1917
@click.version_option(version='1.0.0', prog_name='concore')
@@ -35,7 +33,7 @@ def init(name, template):
3533
@click.argument('workflow_file', type=click.Path(exists=True))
3634
@click.option('--source', '-s', default='src', help='Source directory')
3735
@click.option('--output', '-o', default='out', help='Output directory')
38-
@click.option('--type', '-t', default='windows', type=click.Choice(['windows', 'posix', 'docker']), help='Execution type')
36+
@click.option('--type', '-t', default=DEFAULT_EXEC_TYPE, type=click.Choice(['windows', 'posix', 'docker']), help='Execution type')
3937
@click.option('--auto-build', is_flag=True, help='Automatically run build after generation')
4038
def run(workflow_file, source, output, type, auto_build):
4139
"""Run a concore workflow"""
@@ -58,6 +56,18 @@ def validate(workflow_file, source):
5856
console.print(f"[red]Error:[/red] {str(e)}")
5957
sys.exit(1)
6058

59+
@cli.command()
60+
@click.argument('workflow_file', type=click.Path(exists=True))
61+
@click.option('--source', '-s', default='src', help='Source directory')
62+
@click.option('--json', 'output_json', is_flag=True, help='Output in JSON format')
63+
def inspect(workflow_file, source, output_json):
64+
"""Inspect a workflow file and show its structure"""
65+
try:
66+
inspect_workflow(workflow_file, source, output_json, console)
67+
except Exception as e:
68+
console.print(f"[red]Error:[/red] {str(e)}")
69+
sys.exit(1)
70+
6171
@cli.command()
6272
def status():
6373
"""Show running concore processes"""

0 commit comments

Comments
 (0)