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

Named arguments for predetermined input #169

Open
Kiskadee-dev opened this issue Sep 4, 2023 · 2 comments
Open

Named arguments for predetermined input #169

Kiskadee-dev opened this issue Sep 4, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@Kiskadee-dev
Copy link
Contributor

I feel like the project would benefit from having named arguments

example:

ikabot login passwd sendres --from city1 --to city2 --resource wine --amount 50000

Easy to understand and not that hard to add as an optional form to not break backwards compatibility

@Kiskadee-dev Kiskadee-dev added enhancement New feature or request evaluation required Items is pending review or evaluation by the team labels Sep 4, 2023
@ikagod
Copy link
Collaborator

ikagod commented Sep 5, 2023

I don't really like this idea because it will make the command_line.py module too complicated. We would have to translate the arguments to number choices and I think that would be a bit too hard to debug for people using predetermined arguments. Keep in mind that if this proposal is accepted, we will have to make sure all future modules have this translation. We will also have to find the right order of the arguments before translation.

I feel like the alternative to translating the parameters isn't much better as it would involve extensively modifying all modules and/or the main command_line.py module.

@Kiskadee-dev
Copy link
Contributor Author

Delegating the named argument to the function would be the way to make this optional, in the example, sendres as its not a number would start the section for the named arguments and then pop the inputs until another delimiter is found, since we're dealing with named args then any arg without a name can be the ending delimiter.

this subsection would be parsed and sent to the function as **kwargs and the function would check for them to modify its own behaviour, it'd be entirely optional for the author to make args for his own function.

eg: ikabot [login, passwd] [function name/any non integer] [--from city1 --to city2 --resource wine --amount 50000 ] 14 2 3 ...

@ElieTaillard ElieTaillard removed the evaluation required Items is pending review or evaluation by the team label Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants