@@ -4728,17 +4728,9 @@ def on_exec(self, args: argparse.Namespace):
47284728
47294729
47304730# Scripting commands
4731- @root .command ('script' )
4732- class ScriptRoot (BaseCLIUnit ):
4733- """Script management and execution"""
4734-
4735- def args_parser (self ) -> ArgumentParserNoExit :
4736- parser = ArgumentParserNoExit ()
4737- parser .description = 'Script management and execution'
4738- return parser
4739-
4731+ script = root .subgroup ('script' , 'Script management and execution' )
47404732
4741- @ScriptRoot .command ('run' )
4733+ @script .command ('run' )
47424734class ScriptRun (BaseCLIUnit ):
47434735 """Run a Python script"""
47444736
@@ -4795,7 +4787,7 @@ def on_exec(self, args):
47954787 print (f" [!] { color_string ((CR , f'Error running script: { e } ' ))} " )
47964788
47974789
4798- @ScriptRoot .command ('exec' )
4790+ @script .command ('exec' )
47994791class ScriptExec (BaseCLIUnit ):
48004792 """Execute Python code directly"""
48014793
@@ -4835,7 +4827,7 @@ def on_exec(self, args):
48354827 print (f" [!] { color_string ((CR , f'Error executing code: { e } ' ))} " )
48364828
48374829
4838- @ScriptRoot .command ('list' )
4830+ @script .command ('list' )
48394831class ScriptList (BaseCLIUnit ):
48404832 """List available scripts"""
48414833
@@ -4861,7 +4853,7 @@ def on_exec(self, args):
48614853 print (f" [!] { color_string ((CR , f'Error listing scripts: { e } ' ))} " )
48624854
48634855
4864- @ScriptRoot .command ('save' )
4856+ @script .command ('save' )
48654857class ScriptSave (BaseCLIUnit ):
48664858 """Save a script to file"""
48674859
@@ -4896,7 +4888,7 @@ def on_exec(self, args):
48964888 print (f" [!] { color_string ((CR , f'Error saving script: { e } ' ))} " )
48974889
48984890
4899- @ScriptRoot .command ('show' )
4891+ @script .command ('show' )
49004892class ScriptShow (BaseCLIUnit ):
49014893 """Show script content"""
49024894
@@ -4922,7 +4914,7 @@ def on_exec(self, args):
49224914 print (f" [!] { color_string ((CR , f'Error showing script: { e } ' ))} " )
49234915
49244916
4925- @ScriptRoot .command ('vars' )
4917+ @script .command ('vars' )
49264918class ScriptVars (BaseCLIUnit ):
49274919 """Show current script variables"""
49284920
@@ -4946,7 +4938,7 @@ def on_exec(self, args):
49464938 print (f" [!] { color_string ((CR , f'Error showing variables: { e } ' ))} " )
49474939
49484940
4949- @ScriptRoot .command ('clear' )
4941+ @script .command ('clear' )
49504942class ScriptClear (BaseCLIUnit ):
49514943 """Clear script variables"""
49524944
0 commit comments