88
99from west .commands import WestCommand # your extension must subclass this
1010
11- class ExampleWestCommand (WestCommand ):
1211
12+ class ExampleWestCommand (WestCommand ):
1313 def __init__ (self ):
1414 super ().__init__ (
15- 'example-west-command' , # gets stored as self.name
15+ 'example-west-command' , # gets stored as self.name
1616 'an example west extension command' , # self.help
1717 # self.description:
1818 '''\
@@ -22,21 +22,20 @@ def __init__(self):
2222reflowed for you. You can also pass
2323formatter_class=argparse.RawDescriptionHelpFormatter when calling
2424parser_adder.add_parser() below if you want to keep your line
25- endings.''' )
25+ endings.''' ,
26+ )
2627
2728 def do_add_parser (self , parser_adder ):
2829 # This is a bit of boilerplate, which allows you full control over the
2930 # type of argparse handling you want. The "parser_adder" argument is
3031 # the return value of an argparse.ArgumentParser.add_subparsers() call.
31- parser = parser_adder .add_parser (self .name ,
32- help = self .help ,
33- description = self .description )
32+ parser = parser_adder .add_parser (self .name , help = self .help , description = self .description )
3433
3534 # Add some example options using the standard argparse module API.
3635 parser .add_argument ('-o' , '--optional' , help = 'an optional argument' )
3736 parser .add_argument ('required' , help = 'a required argument' )
3837
39- return parser # gets stored as self.parser
38+ return parser # gets stored as self.parser
4039
4140 def do_run (self , args , unknown_args ):
4241 # This gets called when the user runs the command, e.g.:
0 commit comments