File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ Changelog
14
14
### 2.6.0 - August 28, 2019
15
15
- Improved CLI multiple behaviour with empty defaults
16
16
- Improved CLI type output for built-in types
17
+ - Improved MultiCLI base documentation
17
18
18
19
### 2.5.6 - June 20, 2019
19
20
- Fixed issue #815 : map_params() causes api documentation to lose param type information
Original file line number Diff line number Diff line change @@ -9,10 +9,12 @@ class GIT(object):
9
9
10
10
@hug .object .cli
11
11
def push (self , branch = "master" ):
12
+ """Push the latest to origin"""
12
13
return "Pushing {}" .format (branch )
13
14
14
15
@hug .object .cli
15
16
def pull (self , branch = "master" ):
17
+ """Pull in the latest from origin"""
16
18
return "Pulling {}" .format (branch )
17
19
18
20
Original file line number Diff line number Diff line change @@ -469,10 +469,12 @@ def output_format(self, formatter):
469
469
self ._output_format = formatter
470
470
471
471
def __str__ (self ):
472
- return "{0}\n \n Available Commands:{1}\n " .format (
473
- self .api .doc or self .api .name , "\n \n \t - " + "\n \t - " .join (self .commands .keys ())
474
- )
475
-
472
+ output = "{0}\n \n Available Commands:\n \n " .format (self .api .doc or self .api .name )
473
+ for command_name , command in self .commands .items ():
474
+ command_string = " - {}{}" .format (command_name , ": " + command .parser .description .replace ("\n " , " " ) if command .parser .description else "" )
475
+ output += (command_string [:77 ] + "..." if len (command_string ) > 80 else command_string )
476
+ output += "\n "
477
+ return output
476
478
477
479
class ModuleSingleton (type ):
478
480
"""Defines the module level __hug__ singleton"""
You can’t perform that action at this time.
0 commit comments