forked from polkadot-fellows/runtimes
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
143 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import argparse | ||
|
||
class _HelpAction(argparse._HelpAction): | ||
def __call__(self, parser, namespace, values, option_string=None): | ||
parser.print_help() | ||
|
||
# retrieve subparsers from parser | ||
subparsers_actions = [ | ||
action for action in parser._actions | ||
if isinstance(action, argparse._SubParsersAction)] | ||
# there will probably only be one subparser_action, | ||
# but better save than sorry | ||
for subparsers_action in subparsers_actions: | ||
# get all subparsers and print help | ||
for choice, subparser in subparsers_action.choices.items(): | ||
print("\n----> Command '{}'".format(choice)) | ||
print(subparser.format_help()) | ||
|
||
parser.exit() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,3 +41,4 @@ target/ | |
# act | ||
.secrets | ||
act_*.json | ||
**/__pycache__/ |