[dvblast-devel] [PATCH 7/9] dvblastctl: Add --system-charset/-j option

Georgi Chorbadzhiyski gf at unixsol.org
Thu Jan 25 01:21:56 CET 2018


-------------- next part --------------
From 3b72e9adf913eb08364a1852f804334b7b40eef9 Mon Sep 17 00:00:00 2001
From: Georgi Chorbadzhiyski <gf at unixsol.org>
Date: Sat, 13 Jan 2018 09:47:29 +0200
Subject: [PATCH 7/9] dvblastctl: Add --system-charset/-j option

---
 NEWS         | 1 +
 dvblastctl.c | 8 +++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index d6da445..3d30ba0 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ Changes between 3.2 and -next
   * Add support for getting EIT present/following for chosen service in dvblastctl
   * Add support for getting EIT schedule for chosen service in dvblastctl
   * Switch default string charset to UTF-8//IGNORE
+  * Add --system-charset/-j option to dvblastctl
 
 Changes between 3.1 and 3.2:
 ----------------------------
diff --git a/dvblastctl.c b/dvblastctl.c
index 62a379c..cf88027 100644
--- a/dvblastctl.c
+++ b/dvblastctl.c
@@ -358,6 +358,7 @@ void usage()
     printf("Usage: dvblastctl -r <remote socket> [-x <text|xml>] [cmd]\n");
     printf("Options:\n");
     printf("  -r --remote-socket <name>       Set socket name to <name>.\n" );
+    printf("  -j --system-charset <name>      Character set used for output (default UTF-8//IGNORE)\n" );
     printf("  -x --print <text|xml>           Choose output format for info commands.\n" );
     printf("Control commands:\n");
     printf("  reload                          Reload configuration.\n");
@@ -408,12 +409,13 @@ int main( int i_argc, char **ppsz_argv )
         static const struct option long_options[] =
         {
             {"remote-socket", required_argument, NULL, 'r'},
+            {"system-charset", required_argument, NULL, 'j'},
             {"print", required_argument, NULL, 'x'},
             {"help", no_argument, NULL, 'h'},
             {0, 0, 0, 0}
         };
 
-        if ( (c = getopt_long(i_argc, ppsz_argv, "r:x:h", long_options, NULL)) == -1 )
+        if ( (c = getopt_long(i_argc, ppsz_argv, "r:x:j:h", long_options, NULL)) == -1 )
             break;
 
         switch ( c )
@@ -422,6 +424,10 @@ int main( int i_argc, char **ppsz_argv )
             psz_srv_socket = optarg;
             break;
 
+        case 'j':
+            psz_native_charset = optarg;
+            break;
+
         case 'x':
             if ( !strcmp(optarg, "text") )
                 i_print_type = PRINT_TEXT;
-- 
2.16.0



More information about the dvblast-devel mailing list