添加远程执行快捷参数

This commit is contained in:
yi-ge 2019-08-25 23:46:35 +08:00
parent 533f74e116
commit 5c2bc0824f
2 changed files with 38 additions and 17 deletions

View File

@ -152,16 +152,22 @@ SOFTWARE.
" "
echo "What do you want to do?" if [[ "$1" == "--install" ]]; then
select var in "Install (I accept the MIT License.)" "Uninstall" "Exit"; do
break;
done
echo "You have selected $var."
if [[ $var == "Install (I accept the MIT License.)" ]]; then
Install Install
elif [[ $var == "Uninstall" ]]; then elif [[ "$1" == "--uninstall" ]]; then
Uninstall Uninstall
else else
echo "What do you want to do?"
select var in "Install (I accept the MIT License.)" "Uninstall" "Exit"; do
break;
done
echo "You have selected $var."
if [[ $var == "Install (I accept the MIT License.)" ]]; then
Install
elif [[ $var == "Uninstall" ]]; then
Uninstall
else
exit 0 exit 0
fi
fi fi

View File

@ -139,7 +139,8 @@ namespace setup
return output; return output;
} }
} catch (Exception ex) }
catch (Exception ex)
{ {
return ex.ToString(); return ex.ToString();
} }
@ -285,12 +286,26 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE."); SOFTWARE.");
Console.WriteLine(""); Console.WriteLine("");
Console.WriteLine(""); Console.WriteLine("");
string cmd = "";
if (args.Length > 0 && (args[0] == "--install" || args[0] == "/install"))
{
cmd = "1";
}
else if (args.Length > 0 && (args[0] == "--uninstall" || args[0] == "/uninstall"))
{
cmd = "2";
}
else
{
Console.WriteLine("What do you want to do?"); Console.WriteLine("What do you want to do?");
Console.WriteLine("1) Install (I accept the MIT License.)"); Console.WriteLine("1) Install (I accept the MIT License.)");
Console.WriteLine("2) Uninstall"); Console.WriteLine("2) Uninstall");
Console.WriteLine("3) Exit"); Console.WriteLine("3) Exit");
Console.Write("#?"); Console.Write("#?");
string cmd = Console.ReadLine(); cmd = Console.ReadLine();
}
if (cmd == "1") if (cmd == "1")
{ {