replbase 0.0.54__tar.gz → 0.0.55__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: replbase
3
- Version: 0.0.54
3
+ Version: 0.0.55
4
4
  Summary: "Combination of other REPL tools into a reusable class that generates a REPL"
5
5
  License: MIT
6
6
  Author: Joseph Bochinski
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
4
4
 
5
5
  [tool.poetry]
6
6
  name = "replbase"
7
- version = "0.0.54"
7
+ version = "0.0.55"
8
8
  description = "\"Combination of other REPL tools into a reusable class that generates a REPL\""
9
9
  authors = [ "Joseph Bochinski <stirgejr@gmail.com>",]
10
10
  license = "MIT"
@@ -462,7 +462,7 @@ class ReplBase:
462
462
  self.commands[cmd_name] = new_cmd
463
463
  return new_cmd
464
464
 
465
- def gen_command(self, cmd_name: str) -> ReplCommand:
465
+ def gen_command(self, cmd_name: str, hyphenate: bool = True) -> ReplCommand:
466
466
  if not hasattr(self, cmd_name):
467
467
  return
468
468
 
@@ -471,6 +471,9 @@ class ReplBase:
471
471
  if not callable(cmd):
472
472
  return
473
473
 
474
+ if hyphenate:
475
+ cmd_name = cmd_name.replace("_", "-")
476
+
474
477
  return CommandMeta(func=cmd, register_cmd=self.add_command).gen_command()
475
478
 
476
479
  def setup_cmds(self, *cmd_names: list[str]) -> None:
File without changes
File without changes