11import argparse
22from jenkins import JenkinsException
33
4- from jenkins_cli .cli import JenkinsCli , CliException
4+ from jenkins_cli .cli import JenkinsCli , CliException , get_jobs_legend
55
66
77def main ():
@@ -17,7 +17,10 @@ def main():
1717
1818 subparsers = parser .add_subparsers (title = 'Available commands' , dest = 'jenkins_command' )
1919
20- jobs_parser = subparsers .add_parser ('jobs' , help = 'Show all jobs and their status' )
20+ jobs_parser = subparsers .add_parser ('jobs' ,
21+ help = 'Show all jobs and their statuses' ,
22+ formatter_class = argparse .RawTextHelpFormatter ,
23+ description = "Status description:\n \n " + "\n " .join (get_jobs_legend ()))
2124 jobs_parser .add_argument ('-a' , help = 'Show only active jobs' , default = False , action = 'store_true' )
2225
2326 subparsers .add_parser ('queue' , help = 'Shows builds queue' )
@@ -30,15 +33,15 @@ def main():
3033 start_parser = subparsers .add_parser ('info' , help = 'Job info' )
3134 start_parser .add_argument ('job_name' , help = 'Job to to get info for' )
3235
33- set_branch = subparsers .add_parser ('set_branch ' , help = 'Job info ' )
36+ set_branch = subparsers .add_parser ('setbranch ' , help = 'Set SCM branch ' )
3437 set_branch .add_argument ('job_name' , help = 'Job to to set branch' )
35- set_branch .add_argument ('branch_name' , help = 'Name of the branch' )
38+ set_branch .add_argument ('branch_name' , help = 'Name of the SCM branch' )
3639
3740 stop_parser = subparsers .add_parser ('stop' , help = 'Stop job' )
3841 stop_parser .add_argument ('job_name' , help = 'Job to stop' )
3942
40- console_parser = subparsers .add_parser ('console' , help = 'Show job history ' )
41- console_parser .add_argument ('job_name' , help = 'Job to show history for' )
43+ console_parser = subparsers .add_parser ('console' , help = 'Show console for last build ' )
44+ console_parser .add_argument ('job_name' , help = 'Job to show console for' )
4245 console_parser .add_argument ('-n' , help = 'Show first n num of the lines only(if n is negative, shows last n lines)' , type = int )
4346 console_parser .add_argument ('-i' , help = 'Interactive console' , default = False , action = 'store_true' )
4447
0 commit comments