Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Automatic build of equivalent CLI commands #21

Closed
pawamoy opened this issue May 17, 2024 · 0 comments
Closed

feature: Automatic build of equivalent CLI commands #21

pawamoy opened this issue May 17, 2024 · 0 comments
Assignees

Comments

@pawamoy
Copy link
Owner

pawamoy commented May 17, 2024

Is your feature request related to a problem? Please describe.

When a (lazy) callable provided by duty runs and fails, we output a stringified version of the callable: a string that looks like a Python statement (function call). That is not super helpful because one would have to run an interpreter, guess and import the right things, and run this command again, but it might not exist, etc. To improve this, duty accepts a command argument when running a callable: this command will be used instead of the stringified callable when printing the output, so that users can simply copy/paste this CLI command to re-run it.

The issue here is that users have to provide this command manually when writing their duties. When there are many arguments provided to the callable, it can be tedious to rebuild the right command line. Actually, duty's callables already build the command line, so we should add a way to return/reuse these command lines (without running them) automatically.

Describe the solution you'd like

A way to automatically compute the command argument, or to retrieve it from the lazy callable so that users can choose to pass it down with the command parameter.

Describe alternatives you've considered

/

Additional context

/

@pawamoy pawamoy self-assigned this May 17, 2024
pawamoy added a commit that referenced this issue May 19, 2024
…alue automatically

With this change, we deprecate the previous "callables" in favor of these new tools.

Issue-21: #21
@pawamoy pawamoy closed this as completed May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant