99
1010from ..version import VERSION
1111from . import commands , contexts
12- from .util import CliException , add_subparser
12+ from .util import add_subparser
13+ from .util .errors import CliException
1314
1415_log_levels = {
1516 'debug' : log .DEBUG ,
@@ -59,22 +60,31 @@ def make_parser():
5960 _LogManager ._define_loglevel_option (parser )
6061
6162 known_contexts = [
62- ('project' , contexts .project , "Actions with project (deprecated) " ),
63+ ('project' , contexts .project , "Actions with project" ),
6364 ('source' , contexts .source , "Actions with data sources" ),
6465 ('model' , contexts .model , "Actions with models" ),
6566 ]
6667 known_commands = [
67- ('create' , commands . create , "Create project" ),
68- ('import ' , commands .import_ , "Create project from existing dataset " ),
68+ ("Project modification:" , None , '' ),
69+ ('create ' , commands .create , "Create empty project " ),
6970 ('add' , commands .add , "Add data source to project" ),
7071 ('remove' , commands .remove , "Remove data source from project" ),
72+
73+ ("" , None , '' ),
74+ ("Project versioning:" , None , '' ),
75+ ('checkout' , commands .checkout , "Switch to another branch or revision" ),
76+ ('commit' , commands .commit , "Commit changes in tracked files" ),
77+ ('log' , commands .log , "List history" ),
78+ ('status' , commands .status , "Display current status" ),
79+
80+ ("" , None , '' ),
81+ ("Dataset and project operations:" , None , '' ),
7182 ('export' , commands .export , "Export project in some format" ),
72- ('filter' , commands .filter , "Filter project" ),
73- ('transform' , commands .transform , "Transform project" ),
74- ('merge' , commands .merge , "Merge projects" ),
75- ('convert' , commands .convert , "Convert dataset into another format" ),
76- ('diff' , commands .diff , "Compare projects with intersection" ),
77- ('ediff' , commands .ediff , "Compare projects for equality" ),
83+ ('filter' , commands .filter , "Filter project items" ),
84+ ('transform' , commands .transform , "Modify project items" ),
85+ ('merge' , commands .merge , "Merge datasets" ),
86+ ('convert' , commands .convert , "Convert dataset between formats" ),
87+ ('diff' , commands .diff , "Compare datasets" ),
7888 ('stats' , commands .stats , "Compute project statistics" ),
7989 ('info' , commands .info , "Print project info" ),
8090 ('explain' , commands .explain , "Run Explainable AI algorithm for model" ),
@@ -105,7 +115,8 @@ def make_parser():
105115 subcommands = parser .add_subparsers (title = subcommands_desc ,
106116 description = "" , help = argparse .SUPPRESS )
107117 for command_name , command , _ in known_contexts + known_commands :
108- add_subparser (subcommands , command_name , command .build_parser )
118+ if command is not None :
119+ add_subparser (subcommands , command_name , command .build_parser )
109120
110121 return parser
111122
@@ -121,7 +132,10 @@ def main(args=None):
121132 return 1
122133
123134 try :
124- return args .command (args )
135+ retcode = args .command (args )
136+ if retcode is None :
137+ retcode = 0
138+ return retcode
125139 except CliException as e :
126140 log .error (e )
127141 return 1
0 commit comments