@@ -36,20 +36,10 @@ def get_quiet_logs(ctx):
3636 return False
3737
3838
39- class ElementaryCLI (click .MultiCommand ): # type: ignore[misc, valid-type]
40- _CMD_MAP = {
41- "monitor" : monitor ,
42- "report" : report ,
43- "send-report" : send_report ,
44- "run-operation" : run_operation ,
45- }
46-
47- def list_commands (self , ctx ):
48- return self ._CMD_MAP .keys ()
49-
39+ class ElementaryCLI (click .Group ):
5040 def get_command (self , ctx , name ):
5141 ctx .auto_envvar_prefix = "EDR"
52- return self . _CMD_MAP . get ( name )
42+ return super (). get_command ( ctx , name )
5343
5444 def format_help (self , ctx , formatter ):
5545 try :
@@ -75,7 +65,7 @@ def invoke(self, ctx: click.Context) -> Any:
7565 return super ().invoke (ctx )
7666
7767
78- @click .command (
68+ @click .group (
7969 cls = ElementaryCLI ,
8070 help = "Open source data reliability solution (https://docs.elementary-data.com/)" ,
8171)
@@ -87,5 +77,11 @@ def cli():
8777 pass
8878
8979
80+ cli .add_command (monitor )
81+ cli .add_command (report )
82+ cli .add_command (send_report , name = "send-report" )
83+ cli .add_command (run_operation , name = "run-operation" )
84+
85+
9086if __name__ == "__main__" :
9187 cli ()
0 commit comments