Add 'evmctl --version' version reporting
authorDmitry Kasatkin <d.kasatkin@samsung.com>
Tue, 23 Sep 2014 11:12:19 +0000 (14:12 +0300)
committerDmitry Kasatkin <d.kasatkin@samsung.com>
Tue, 23 Sep 2014 11:40:18 +0000 (14:40 +0300)
Signed-off-by: Dmitry Kasatkin <d.kasatkin@samsung.com>
README
src/evmctl.c

diff --git a/README b/README
index 6bc2368..c14a3ed 100644 (file)
--- a/README
+++ b/README
@@ -23,6 +23,7 @@ used to import keys into the kernel keyring.
 COMMANDS
 --------
 
+ --version
  help <command>
  import [--rsa] pubkey keyring
  sign [-r] [--imahash | --imasig ] [--key key] [--pass password] file
index f2d9c3a..109b82a 100644 (file)
@@ -1482,6 +1482,7 @@ static void usage(void)
 }
 
 struct command cmds[] = {
+       {"--version", NULL, 0, ""},
        {"help", cmd_help, 0, "<command>"},
        {"import", cmd_import, 0, "[--rsa] pubkey keyring", "Import public key into the keyring.\n"},
        {"sign", cmd_sign_evm, 0, "[-r] [--imahash | --imasig ] [--key key] [--pass password] file", "Sign file metadata.\n"},
@@ -1513,6 +1514,7 @@ static struct option opts[] = {
        {"m32", 0, 0, '3'},
        {"m64", 0, 0, '6'},
        {"smack", 0, 0, 256},
+       {"version", 0, 0, 257},
        {}
 
 };
@@ -1586,6 +1588,10 @@ int main(int argc, char *argv[])
                case 256:
                        evm_config_xattrnames = evm_extra_smack_xattrs;
                        break;
+               case 257:
+                       printf("evmctl %s\n", VERSION);
+                       exit(0);
+                       break;
                case '?':
                        exit(1);
                        break;