falyx 0.1.41__tar.gz → 0.1.42__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.
Files changed (61) hide show
  1. {falyx-0.1.41 → falyx-0.1.42}/PKG-INFO +1 -1
  2. {falyx-0.1.41 → falyx-0.1.42}/falyx/command.py +3 -1
  3. {falyx-0.1.41 → falyx-0.1.42}/falyx/falyx.py +20 -5
  4. {falyx-0.1.41 → falyx-0.1.42}/falyx/parsers/parsers.py +7 -8
  5. falyx-0.1.42/falyx/version.py +1 -0
  6. {falyx-0.1.41 → falyx-0.1.42}/pyproject.toml +1 -1
  7. falyx-0.1.41/falyx/version.py +0 -1
  8. {falyx-0.1.41 → falyx-0.1.42}/LICENSE +0 -0
  9. {falyx-0.1.41 → falyx-0.1.42}/README.md +0 -0
  10. {falyx-0.1.41 → falyx-0.1.42}/falyx/.pytyped +0 -0
  11. {falyx-0.1.41 → falyx-0.1.42}/falyx/__init__.py +0 -0
  12. {falyx-0.1.41 → falyx-0.1.42}/falyx/__main__.py +0 -0
  13. {falyx-0.1.41 → falyx-0.1.42}/falyx/action/.pytyped +0 -0
  14. {falyx-0.1.41 → falyx-0.1.42}/falyx/action/__init__.py +0 -0
  15. {falyx-0.1.41 → falyx-0.1.42}/falyx/action/action.py +0 -0
  16. {falyx-0.1.41 → falyx-0.1.42}/falyx/action/action_factory.py +0 -0
  17. {falyx-0.1.41 → falyx-0.1.42}/falyx/action/action_group.py +0 -0
  18. {falyx-0.1.41 → falyx-0.1.42}/falyx/action/base.py +0 -0
  19. {falyx-0.1.41 → falyx-0.1.42}/falyx/action/chained_action.py +0 -0
  20. {falyx-0.1.41 → falyx-0.1.42}/falyx/action/fallback_action.py +0 -0
  21. {falyx-0.1.41 → falyx-0.1.42}/falyx/action/http_action.py +0 -0
  22. {falyx-0.1.41 → falyx-0.1.42}/falyx/action/io_action.py +0 -0
  23. {falyx-0.1.41 → falyx-0.1.42}/falyx/action/literal_input_action.py +0 -0
  24. {falyx-0.1.41 → falyx-0.1.42}/falyx/action/menu_action.py +0 -0
  25. {falyx-0.1.41 → falyx-0.1.42}/falyx/action/mixins.py +0 -0
  26. {falyx-0.1.41 → falyx-0.1.42}/falyx/action/process_action.py +0 -0
  27. {falyx-0.1.41 → falyx-0.1.42}/falyx/action/process_pool_action.py +0 -0
  28. {falyx-0.1.41 → falyx-0.1.42}/falyx/action/prompt_menu_action.py +0 -0
  29. {falyx-0.1.41 → falyx-0.1.42}/falyx/action/select_file_action.py +0 -0
  30. {falyx-0.1.41 → falyx-0.1.42}/falyx/action/selection_action.py +0 -0
  31. {falyx-0.1.41 → falyx-0.1.42}/falyx/action/signal_action.py +0 -0
  32. {falyx-0.1.41 → falyx-0.1.42}/falyx/action/types.py +0 -0
  33. {falyx-0.1.41 → falyx-0.1.42}/falyx/action/user_input_action.py +0 -0
  34. {falyx-0.1.41 → falyx-0.1.42}/falyx/bottom_bar.py +0 -0
  35. {falyx-0.1.41 → falyx-0.1.42}/falyx/config.py +0 -0
  36. {falyx-0.1.41 → falyx-0.1.42}/falyx/context.py +0 -0
  37. {falyx-0.1.41 → falyx-0.1.42}/falyx/debug.py +0 -0
  38. {falyx-0.1.41 → falyx-0.1.42}/falyx/exceptions.py +0 -0
  39. {falyx-0.1.41 → falyx-0.1.42}/falyx/execution_registry.py +0 -0
  40. {falyx-0.1.41 → falyx-0.1.42}/falyx/hook_manager.py +0 -0
  41. {falyx-0.1.41 → falyx-0.1.42}/falyx/hooks.py +0 -0
  42. {falyx-0.1.41 → falyx-0.1.42}/falyx/init.py +0 -0
  43. {falyx-0.1.41 → falyx-0.1.42}/falyx/logger.py +0 -0
  44. {falyx-0.1.41 → falyx-0.1.42}/falyx/menu.py +0 -0
  45. {falyx-0.1.41 → falyx-0.1.42}/falyx/options_manager.py +0 -0
  46. {falyx-0.1.41 → falyx-0.1.42}/falyx/parsers/.pytyped +0 -0
  47. {falyx-0.1.41 → falyx-0.1.42}/falyx/parsers/__init__.py +0 -0
  48. {falyx-0.1.41 → falyx-0.1.42}/falyx/parsers/argparse.py +0 -0
  49. {falyx-0.1.41 → falyx-0.1.42}/falyx/parsers/signature.py +0 -0
  50. {falyx-0.1.41 → falyx-0.1.42}/falyx/parsers/utils.py +0 -0
  51. {falyx-0.1.41 → falyx-0.1.42}/falyx/prompt_utils.py +0 -0
  52. {falyx-0.1.41 → falyx-0.1.42}/falyx/protocols.py +0 -0
  53. {falyx-0.1.41 → falyx-0.1.42}/falyx/retry.py +0 -0
  54. {falyx-0.1.41 → falyx-0.1.42}/falyx/retry_utils.py +0 -0
  55. {falyx-0.1.41 → falyx-0.1.42}/falyx/selection.py +0 -0
  56. {falyx-0.1.41 → falyx-0.1.42}/falyx/signals.py +0 -0
  57. {falyx-0.1.41 → falyx-0.1.42}/falyx/tagged_table.py +0 -0
  58. {falyx-0.1.41 → falyx-0.1.42}/falyx/themes/__init__.py +0 -0
  59. {falyx-0.1.41 → falyx-0.1.42}/falyx/themes/colors.py +0 -0
  60. {falyx-0.1.41 → falyx-0.1.42}/falyx/utils.py +0 -0
  61. {falyx-0.1.41 → falyx-0.1.42}/falyx/validators.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: falyx
3
- Version: 0.1.41
3
+ Version: 0.1.42
4
4
  Summary: Reliable and introspectable async CLI action framework.
5
5
  License: MIT
6
6
  Author: Roland Thomas Jr
@@ -313,7 +313,9 @@ class Command(BaseModel):
313
313
  if not self.arg_parser:
314
314
  return "No arguments defined."
315
315
 
316
- return self.arg_parser.get_usage(plain_text=True)
316
+ command_keys_text = self.arg_parser.get_command_keys_text(plain_text=True)
317
+ options_text = self.arg_parser.get_options_text(plain_text=True)
318
+ return f" {command_keys_text:<20} {options_text} "
317
319
 
318
320
  def log_summary(self) -> None:
319
321
  if self._context:
@@ -830,10 +830,11 @@ class Falyx:
830
830
  self.console.print(
831
831
  f"[{OneColors.LIGHT_YELLOW}]⚠️ Unknown command '{choice}'[/]"
832
832
  )
833
- raise ValidationError(
834
- message=f"Unknown command '{choice}'.",
835
- cursor_position=len(raw_choices),
836
- )
833
+ else:
834
+ raise ValidationError(
835
+ message=f"Unknown command '{choice}'.",
836
+ cursor_position=len(raw_choices),
837
+ )
837
838
  return is_preview, None, args, kwargs
838
839
 
839
840
  def _create_context(self, selected_command: Command) -> ExecutionContext:
@@ -1149,9 +1150,23 @@ class Falyx:
1149
1150
  f"[{OneColors.CYAN_b}]🚀 Running all commands with tag:[/] "
1150
1151
  f"{self.cli_args.tag}"
1151
1152
  )
1153
+
1152
1154
  for cmd in matching:
1153
1155
  self._set_retry_policy(cmd)
1154
- await self.run_key(cmd.key)
1156
+ try:
1157
+ await self.run_key(cmd.key)
1158
+ except FalyxError as error:
1159
+ self.console.print(f"[{OneColors.DARK_RED}]❌ Error: {error}[/]")
1160
+ sys.exit(1)
1161
+ except QuitSignal:
1162
+ logger.info("[QuitSignal]. <- Exiting run.")
1163
+ sys.exit(0)
1164
+ except BackSignal:
1165
+ logger.info("[BackSignal]. <- Exiting run.")
1166
+ sys.exit(0)
1167
+ except CancelSignal:
1168
+ logger.info("[CancelSignal]. <- Exiting run.")
1169
+ sys.exit(0)
1155
1170
 
1156
1171
  if self.cli_args.summary:
1157
1172
  er.summary()
@@ -88,22 +88,21 @@ def get_arg_parsers(
88
88
  parser.add_argument("--version", action="store_true", help="Show Falyx version")
89
89
  subparsers = parser.add_subparsers(dest="command")
90
90
 
91
- run_description = "Run a command by its key or alias."
92
- run_epilog = ["commands:"]
91
+ run_description = ["Run a command by its key or alias.\n"]
92
+ run_description.append("commands:")
93
93
  if isinstance(commands, dict):
94
94
  for command in commands.values():
95
- run_epilog.append(command.usage)
95
+ run_description.append(command.usage)
96
96
  command_description = command.description or command.help_text
97
- run_epilog.append(f" {command_description}")
98
- run_epilog.append(" ")
99
- run_epilog.append(
97
+ run_description.append(f"{' '*24}{command_description}")
98
+ run_epilog = (
100
99
  "Tip: Use 'falyx run ?[COMMAND]' to preview commands by their key or alias."
101
100
  )
102
101
  run_parser = subparsers.add_parser(
103
102
  "run",
104
103
  help="Run a specific command",
105
- description=run_description,
106
- epilog="\n".join(run_epilog),
104
+ description="\n".join(run_description),
105
+ epilog=run_epilog,
107
106
  formatter_class=RawDescriptionHelpFormatter,
108
107
  )
109
108
  run_parser.add_argument("name", help="Run a command by its key or alias")
@@ -0,0 +1 @@
1
+ __version__ = "0.1.42"
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "falyx"
3
- version = "0.1.41"
3
+ version = "0.1.42"
4
4
  description = "Reliable and introspectable async CLI action framework."
5
5
  authors = ["Roland Thomas Jr <roland@rtj.dev>"]
6
6
  license = "MIT"
@@ -1 +0,0 @@
1
- __version__ = "0.1.41"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes