Author: metze Date: 2005-09-06 19:29:20 +0000 (Tue, 06 Sep 2005) New Revision: 10057
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=10057 Log: [EMAIL PROTECTED] (orig r10052): jelmer | 2005-09-06 17:44:08 +0200 Add 'print' command Modified: branches/SOC/SAMBA_4_0/ branches/SOC/SAMBA_4_0/source/lib/registry/tools/regshell.c Changeset: Property changes on: branches/SOC/SAMBA_4_0 ___________________________________________________________________ Name: svk:merge - 0c0555d6-39d7-0310-84fc-f1cc0bd64818:/branches/SAMBA_4_0:10048 3a72dc49-98ff-0310-ab52-9b7ed7945d91:/local/samba4:9495 a953eb74-4aff-0310-a63c-855d20285ebb:/local/samba4:11627 d349723c-e9fc-0310-b8a8-fdedf1c27407:/local/SAMBA_4_0:5616 d349723c-e9fc-0310-b8a8-fdedf1c27407:/local/samba-SAMBA_4_0:5609 + 0c0555d6-39d7-0310-84fc-f1cc0bd64818:/branches/SAMBA_4_0:10052 3a72dc49-98ff-0310-ab52-9b7ed7945d91:/local/samba4:9495 a953eb74-4aff-0310-a63c-855d20285ebb:/local/samba4:11627 d349723c-e9fc-0310-b8a8-fdedf1c27407:/local/SAMBA_4_0:5616 d349723c-e9fc-0310-b8a8-fdedf1c27407:/local/samba-SAMBA_4_0:5609 Modified: branches/SOC/SAMBA_4_0/source/lib/registry/tools/regshell.c =================================================================== --- branches/SOC/SAMBA_4_0/source/lib/registry/tools/regshell.c 2005-09-06 18:20:23 UTC (rev 10056) +++ branches/SOC/SAMBA_4_0/source/lib/registry/tools/regshell.c 2005-09-06 19:29:20 UTC (rev 10057) @@ -35,6 +35,7 @@ * ch - change hive * info - show key info * save - save hive + * print - print value * help * exit */ @@ -123,6 +124,26 @@ return new; } +static struct registry_key *cmd_print(TALLOC_CTX *mem_ctx, struct registry_context *ctx,struct registry_key *cur, int argc, char **argv) +{ + struct registry_value *value; + WERROR error; + + if (argc != 2) { + fprintf(stderr, "Usage: print <valuename>"); + return NULL; + } + + error = reg_key_get_value_by_name(mem_ctx, cur, argv[1], &value); + if (!W_ERROR_IS_OK(error)) { + fprintf(stderr, "No such value '%s'\n", argv[1]); + return NULL; + } + + printf("%s\n%s\n", str_regtype(value->data_type), reg_val_data_string(mem_ctx, value)); + return NULL; +} + static struct registry_key *cmd_ls(TALLOC_CTX *mem_ctx, struct registry_context *ctx,struct registry_key *cur, int argc, char **argv) { int i; @@ -208,6 +229,7 @@ {"ck", "cd", "Change current key", cmd_ck }, {"info", "i", "Show detailed information of a key", cmd_info }, {"list", "ls", "List values/keys in current key", cmd_ls }, + {"print", "p", "Print value", cmd_print }, {"mkkey", "mkdir", "Make new key", cmd_mkkey }, {"rmval", "rm", "Remove value", cmd_rmval }, {"rmkey", "rmdir", "Remove key", cmd_rmkey },