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

Modify script to support CLI arguments. #34

Open
a-t-0 opened this issue Sep 20, 2021 · 3 comments
Open

Modify script to support CLI arguments. #34

a-t-0 opened this issue Sep 20, 2021 · 3 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@a-t-0
Copy link
Contributor

a-t-0 commented Sep 20, 2021

The usage should be analog to what is described here. In essence:
running:
productivity-install.sh
should return the usage, like:

run `productivity-install.sh --choice` to manually select which elements you want to install and configure.
run `productivity-install.sh --language-tool` to automatically install language-tool
run `productivity-install.sh --latex` to automatically install latex
run `productivity-install.sh --gitlab ssh tor` to automatically install GitLab, set up your ssh and host it over tor.
etc.

Ps. I think arguments like --gitlab ssh tor might cause a problem, because it may expect only 1 space separated argument, so either ssh or tor so perhaps find a clever way to support passing multiple configuration parameters.

Similarly build an interface for the productivity-uninstall.sh

An example of how to set up such command line argument parsing can be found here for install:
https://github.com/Deployment-Oneliners/Self-host-GitLab-Server-and-Runner-CI/blob/master/install_gitlab.sh
and here for uninstall:
https://github.com/Deployment-Oneliners/Self-host-GitLab-Server-and-Runner-CI/blob/master/uninstall_gitlab.sh

@a-t-0 a-t-0 added help wanted Extra attention is needed good first issue Good for newcomers labels Sep 20, 2021
@Prashant937
Copy link

Do we need to create this productivity.sh file, or it is there?

@a-t-0
Copy link
Contributor Author

a-t-0 commented Jan 24, 2022

Thank you for your question! The answer is no, it is there, except it is currently called main.sh. FYI, here is an example of the argument passing style (such that it can be tested): https://github.com/Simple-Setup/Self-host-GitLab-Server-and-Runner-CI/blob/develop/install_gitlab.sh and here is an example on how to test if the argument parsing returns the right responses: https://github.com/Simple-Setup/Self-host-GitLab-Server-and-Runner-CI/blob/develop/test/test_uninstall.bats I would like to express slight preference to a relatively similar filestructure for the productivity-install.sh/main.sh file.

Of course you are free to do as you think is best.

@Prashant937
Copy link

okay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants