From 0a33131ce60d1a481bfb4e18f817c27ae70636c2 Mon Sep 17 00:00:00 2001 From: MatMoul Date: Sat, 29 Oct 2016 15:20:41 +0200 Subject: [PATCH] Add -lk (list keys) help) --- src/main.cpp | 111 ++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 101 insertions(+), 10 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 83f7d0f..3a927ef 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -46,6 +46,96 @@ void usage() { cout< 1) { string argCmd = argv[1]; - if (argCmd == "-h" || argCmd == "--help") { usage(); return 0; } - else if (argCmd == "-s" && argc == 3) return setStartupEffect(argv[2]); - else if (argCmd == "-a" && argc == 3) return setAllKeys(argv[2], true); - else if (argCmd == "-an" && argc == 3) return setAllKeys(argv[2], false); - else if (argCmd == "-g" && argc == 4) return setGroupKeys(argv[2], argv[3], true); - else if (argCmd == "-gn" && argc == 4) return setGroupKeys(argv[2], argv[3], false); - else if (argCmd == "-k" && argc == 4) return setKey(argv[2], argv[3], true); - else if (argCmd == "-kn" && argc == 4) return setKey(argv[2], argv[3], false); - else if (argCmd == "-c" && argc == 2) return commit(); - else if (argCmd == "-p" && argc == 3) return loadProfile(argv[2]); + if (argCmd == "-h" || argCmd == "--help") { usage(); return 0; } + else if (argCmd == "-lk" || argCmd == "--list-keys") { listkeys(); return 0; } + else if (argCmd == "-s" && argc == 3) return setStartupEffect(argv[2]); + else if (argCmd == "-a" && argc == 3) return setAllKeys(argv[2], true); + else if (argCmd == "-an" && argc == 3) return setAllKeys(argv[2], false); + else if (argCmd == "-g" && argc == 4) return setGroupKeys(argv[2], argv[3], true); + else if (argCmd == "-gn" && argc == 4) return setGroupKeys(argv[2], argv[3], false); + else if (argCmd == "-k" && argc == 4) return setKey(argv[2], argv[3], true); + else if (argCmd == "-kn" && argc == 4) return setKey(argv[2], argv[3], false); + else if (argCmd == "-c" && argc == 2) return commit(); + else if (argCmd == "-p" && argc == 3) return loadProfile(argv[2]); } usage(); return 1;