Skip to content

Commit

Permalink
try performace improvements for shell completions
Browse files Browse the repository at this point in the history
  • Loading branch information
popenta committed Jan 31, 2024
1 parent 586c267 commit 905ef7d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 17 deletions.
10 changes: 7 additions & 3 deletions multiversx_sdk_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,14 @@ def main(cli_args: List[str] = sys.argv[1:]):

def _do_main(cli_args: List[str]):
utils.ensure_folder(config.SDK_PATH)
argv_with_config_args = config.add_config_args(cli_args)
parser = setup_parser(argv_with_config_args)
# argv_with_config_args = config.add_config_args(cli_args)
# parser = setup_parser(argv_with_config_args)
# argcomplete.autocomplete(parser)
# args = parser.parse_args(argv_with_config_args)

parser = setup_parser(cli_args)
argcomplete.autocomplete(parser)
args = parser.parse_args(argv_with_config_args)
args = parser.parse_args(cli_args)

if args.verbose:
logging.basicConfig(level="DEBUG", force=True, format='%(name)s: %(message)s', handlers=[RichHandler(show_time=False, rich_tracebacks=True)])
Expand Down
13 changes: 0 additions & 13 deletions multiversx_sdk_cli/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,24 +202,11 @@ def add_config_args(argv: List[str]) -> List[str]:
except KeyError:
return argv

check_for_deprecated_args(config_args)

final_args = determine_final_args(argv, config_args)
print(f"Found extra arguments in mxpy.json. Final arguments: {final_args}")
return final_args


def check_for_deprecated_args(args: List[str]) -> None:
if "proxy" in args:
show_warning("Providing `proxy` in the configuration file is deprecated. It will not be used. Please remove it!")

if "chainID" in args:
show_warning("Providing `chainID` in the configuration file is deprecated. It will not be used. Please remove it!")

if "txVersion" in args:
show_warning("Providing `txVersion` in the configuration file is deprecated. It will not be used. Please remove it!")


def determine_final_args(argv: List[str], config_args: Dict[str, Any]) -> List[str]:
extra_args: List[str] = []
for key, value in config_args.items():
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies = [
"multiversx-sdk-network-providers>=0.12.0,<0.13.0",
"multiversx-sdk-wallet>=0.8.0,<0.9.0,",
"multiversx-sdk-core>=0.7.0,<0.8.0",
"argcomplete"
"argcomplete==3.2.2"
]

[project.scripts]
Expand Down

0 comments on commit 905ef7d

Please sign in to comment.