GameServerManagers / LinuxGSM

The command-line tool for quick, simple deployment and management of Linux dedicated game servers.
https://linuxgsm.com
MIT License
4.28k stars 818 forks source link

Add promps to core_messages.sh #617

Closed UltimateByte closed 8 years ago

UltimateByte commented 8 years ago

Creating functions for pre-defined prompts could save some code space. What do you think ?

Edit : Could also make it easy to avoid prompts using a "noprompt=1" variable, which would select the default answer. Would be a way to much more simple auto-installs.

jaredballou commented 8 years ago

Can you give an example? Is it something we can use i LGSM, or is it specific to your tool?

UltimateByte commented 8 years ago

Just every time LGSM prints a prompt for the user ton confirm, it could be a function instead of a rough code every time.

For example this : https://github.com/dgibbs64/linuxgsm/blob/master/functions/command_backup.sh#L22

Could be replaced by : fn_continue

That would be found in core_messages.sh

jaredballou commented 8 years ago

Ideally, there also ought to be a "silent mode" where we can select either answer yes automatically to the default yes questions, or simply skip all interactive prompts. I've had issues with that and automating it in the past, being able to suppress and affirm all the checks would be nice.

UltimateByte commented 8 years ago

I 100% agree, after doing that, implementing a variable to run it only if silentmode variable is found and == 1 will be quite easy.

jaredballou commented 8 years ago

I may take a crack at this later. Just had a very full day of hacking, going to give it a rest :D

UltimateByte commented 8 years ago

Note : some games cannot support silent mode as they absolutely need user input. silentmode variable would probably be either in servername script file, or in the future servername.cfg file so it's not a problem selecting games for which we want this option available or not though.

dgibbs64 commented 8 years ago

there is an auto install mode available for automation however backup/console and debug do not as they require user interaction anyway. Stream lining the prompts may be a good idea. However I am not prioritising it.

UltimateByte commented 8 years ago

Yep. The main idea however was to save some code by putting prompts in a separate file, with a function per prompt, as you did with for messages like [OK], [WARN], [Info]...

UltimateByte commented 8 years ago

So should we do this ?

dgibbs64 commented 8 years ago

I have looked at the prompts. There are differences in many of them. Im sure what you are proposing could be done. However I don't think it is really needed and adds more complexity.

lock[bot] commented 5 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.