Skip to content

Commit

Permalink
Added support for the run command without additional parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
genius257 committed Sep 9, 2022
1 parent a787859 commit 177a9ce
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions commands/run.au3
Expand Up @@ -2,6 +2,21 @@

$json = au3pm_json_load()

If $CmdLine[0] = 1 Then
;list available scripts.
ConsoleWrite('Available scripts:'&@CRLF)
If $json.Item('scripts').Count = 0 Then
ConsoleWrite('No scripts available.'&@CRLF)
Exit 0
EndIf

$aKeys = $json.Item('scripts').Keys()
For $sKey In $aKeys
ConsoleWrite(' - '&$sKey&@CRLF)
Next
Exit 0
EndIf

If Not $json.Item('scripts').Exists($CmdLine[2]) Then
ConsoleWriteErrorLine(StringFormat('script "%s" does not exist', $CmdLine[2]))
Exit 0
Expand Down

0 comments on commit 177a9ce

Please sign in to comment.