Skip to content

Commit

Permalink
🚸 enhanced prompt with menu
Browse files Browse the repository at this point in the history
Signed-off-by: rjdbcm <[email protected]>
  • Loading branch information
rjdbcm committed Jun 22, 2024
1 parent b22b44c commit e8ac4e0
Show file tree
Hide file tree
Showing 2 changed files with 384 additions and 141 deletions.
8 changes: 3 additions & 5 deletions ozi/new/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,23 +134,21 @@ def wrap(project: Namespace) -> None: # pragma: no cover
f.write(template.render())


def main() -> None: # pragma: no cover
def main(args: list[str] | None = None) -> None: # pragma: no cover
"""Main ozi.new entrypoint."""
pipe = sys.stdin if not sys.stdin.isatty() else None
args = (
list(chain.from_iterable([shlex.split(line.strip()) for line in pipe]))
if pipe
else None
else args
)
ozi_new = parser.parse_args(args=args)
ozi_new.argv = args if args else shlex.join(sys.argv[1:])
match ozi_new:
case ozi_new if ozi_new.new in ['i', 'interactive']:
args = interactive_prompt()
ozi_new = parser.parse_args(args=args)
ozi_new.argv = args
project(ozi_new)
TAP.end()
main(args)
case ozi_new if ozi_new.new in ['p', 'project']:
project(ozi_new)
TAP.end()
Expand Down
Loading

0 comments on commit e8ac4e0

Please sign in to comment.