Commit 9d07d6f3 authored by louis-riviere-xyz's avatar louis-riviere-xyz
Browse files

commands

parent 00db0f0c
......@@ -7,7 +7,7 @@ readme = open(join(curdir, 'README.md')).read()
setup(
name = 'setux_repl',
version = '0.22.25.8',
version = '0.22.25.9',
description = 'System deployment',
long_description = readme,
long_description_content_type='text/markdown',
......
from sys import version_info
from pybrary.command import Command, Param, ValidationError
from setux.core.manage import Manager
......@@ -66,6 +64,7 @@ class Help(Command):
def run(self):
target = self.get('target')
obj = self.get('help_obj')
'''
if version_info >= (3, 10):
match obj:
case Command() as command:
......@@ -80,18 +79,19 @@ class Help(Command):
case _:
print(usage)
else:
if isinstance(obj, Command):
command = obj
header(f'Command {command.__class__.__name__}')
command.help(fetch=False)
if isinstance(obj, Manager):
manager = obj
header(f'{manager}'.replace('.', ' '))
manager.help()
if isinstance(obj, Module):
module = obj
header(f'Module {module.__module__.split(".")[-1]}')
module.help()
else:
print(usage)
'''
if isinstance(obj, Command):
command = obj
header(f'Command {command.__class__.__name__}')
command.help(fetch=False)
elif isinstance(obj, Manager):
manager = obj
header(f'{manager}'.replace('.', ' '))
manager.help()
elif isinstance(obj, Module):
module = obj
header(f'Module {module.__module__.split(".")[-1]}')
module.help()
else:
print(usage)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment