2021-03-03 19:37:35 +01:00
from cpl . console . console import Console
2021-03-04 17:36:02 +01:00
from cpl_cli . command_abc import CommandABC
2021-03-03 19:37:35 +01:00
2021-03-04 17:36:02 +01:00
class Help ( CommandABC ) :
2021-03-03 19:37:35 +01:00
def __init__ ( self ) :
2021-03-04 17:36:02 +01:00
CommandABC . __init__ ( self )
2021-03-03 19:37:35 +01:00
def run ( self , args : list [ str ] ) :
Console . write_line ( ' Available Commands: ' )
commands = [
[ ' build (-b|-B) ' , ' Prepares files for publishing into an output directory named dist/ at the given output path. Must be executed from within a workspace directory. ' ] ,
2021-03-03 19:47:55 +01:00
[ ' generate (-g|-G) ' , ' Generate a new file. ' ] ,
2021-03-03 19:37:35 +01:00
[ ' help (-h|-H) ' , ' Lists available commands and their short descriptions. ' ] ,
2021-03-03 19:47:55 +01:00
[ ' new (-n|-N) ' , ' Creates new CPL project. ' ] ,
[ ' start (-s|-S) ' , ' Starts CPL project, restarting on file changes ' ] ,
2021-03-03 19:37:35 +01:00
[ ' publish (-p|-P) ' , ' Prepares files for publishing into an output directory named dist/ at the given output path and executes setup.py. Must be executed from within a workspace directory. ' ] ,
2021-03-03 19:47:55 +01:00
[ ' update (-u|-u) ' , ' Update CPL and project dependencies. ' ] ,
2021-03-03 19:37:35 +01:00
[ ' version (-v|-V) ' , ' Outputs CPL CLI version. ' ]
]
for name , description in commands :
Console . set_foreground_color ( ' blue ' )
Console . write ( f ' \n \t { name } ' )
Console . set_foreground_color ( ' default ' )
Console . write ( f ' { description } ' )
Console . write ( ' \n ' )