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

feat: add support for interactive args #112

Merged
merged 12 commits into from
Sep 24, 2024

Conversation

abhijeetSaroha
Copy link
Collaborator

I have implemented a feature to enable interactive arguments using the input method instead of prompt. The reason for choosing input is to avoid the square brackets ([]) displayed during prompts. For example:

  • with prompt:
username []:
password []:
  • with input:
username:
password:

I have tested the feature. Additionally, I have created a test file for this implementation. Please review and test from your side whenever you have time.

Solves #42

@abhijeetSaroha
Copy link
Collaborator Author

@xmnlab Please review it.

@abhijeetSaroha abhijeetSaroha changed the title feat: add interactive args feat: add support for interactive args Sep 21, 2024
@xmnlab
Copy link
Member

xmnlab commented Sep 21, 2024

@abhijeetSaroha could you rebase your branch on top of the upstream/main please²

.makim.yaml Outdated
- task: smoke-tests.dir-absolute-path
- task: smoke-tests.dir-no-path
- task: smoke-tests.dir-relative-path
# - task: smoke-tests.simple
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for disabling all thse tests?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No...I just testing the interactive-args...so I comment down other test cases and forget to un-comment them before committing the changes. Sorry..

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have commit the new changes.

@xmnlab
Copy link
Member

xmnlab commented Sep 22, 2024

@abhijeetSaroha thanks for working on that!
could you change it to use prompt instead of input. prompt is much more robust than input, and it will allow us to use types and default easily.

the issue you mentioned:

username []:
password []:

that happens because the default is an empty string. you can test with:

import click

click.prompt('Type your name', type=str, default="myname")
click.prompt('Type your name', type=str, default="")
click.prompt('Type your name', type=str)

so for now that is not an issue, maybe in the future we could just try to change the way it is displayed.

@abhijeetSaroha
Copy link
Collaborator Author

I made the required changes. It is working fine with prompt.

.makim.yaml Show resolved Hide resolved
@xmnlab xmnlab merged commit f422e30 into osl-incubator:main Sep 24, 2024
14 checks passed
@xmnlab
Copy link
Member

xmnlab commented Sep 24, 2024

thanks for working on that @abhijeetSaroha

@abhijeetSaroha abhijeetSaroha deleted the interactive-args branch September 26, 2024 03:10
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

Successfully merging this pull request may close these issues.

2 participants