Hi Mort,

On Fri, Sep 26, 2014 at 03:54:49PM +0200, M. wrote:
> Hi Andreas,
> 
> With regard to bug #762893, I cannot reproduce this one (on my
> black-on-white terminal, tested both on xterm and gnome-terminal), so I
> guess it might be on a non-standard configuration or something (specific to
> Debian, maybe).

I admit I havn't seen it on my machine but there are a plenty of cases
where I could imagine this problem.
 
> I'm kind of reluctant to replace less with man, since man looks for an
> external man page but I want to build everything into one single executable
> so that it won't rely on an external location to look for something, easier
> for those who want to use the script without an installation. However,
> since distro packagers can always make sure the man page `trans.1` is
> installed to the correct place, it might be redundant to keep the whole man
> page embedded in the executable then.

I perfectly agree to this.

> If you think the issue might be
> relevant, you can apply a quick patch on your side (remove fancy output
> from `trans -h` and hint users for the existing man page; See the
> attachment); however it is up to you.

Paul, would you consider this patch a valid solution for your problem?
 
> Thanks for the forwarding, I'll keep an eye on the issue tracker then.

:-)

Thanks a lot for your always quick reply

      Andreas.
 
> On Fri, Sep 26, 2014 at 2:06 PM, Andreas Tille <andr...@an3as.eu> wrote:
> 
> > Hi Mort,
> >
> > I guess people will keep on using the Debian BTS and I'm to lazy to
> > inject it into your bug tracker if a simple forward of the mail will do
> > it as well.
> >
> > I guess the distribution in Debian will bring some feedback. :-)
> > If you want to get the feedback directly you can subscribe all issues
> > of translate-shell here:
> >
> >     https://packages.qa.debian.org/common/
> >
> > Kind regards
> >
> >        Andreas.
> >
> > ----- Forwarded message from Paul Wise <p...@debian.org> -----
> >
> > Date: Fri, 26 Sep 2014 08:34:05 +0800
> > From: Paul Wise <p...@debian.org>
> > To: Debian Bug Tracking System <sub...@bugs.debian.org>
> > Subject: Bug#762893: translate-shell: ugly --help output
> > X-Debian-PR-Message: report 762893
> > X-Debian-PR-Package: translate-shell
> > X-Debian-PR-Keywords:
> > X-Debian-PR-Source: translate-shell
> >
> > Package: translate-shell
> > Version: 0.8.21-1
> > Severity: normal
> >
> > When I run `trans --help` I get the ugly output below. All instances of
> > ^L are highlighted in black background (on a black on white terminal).
> > When I load the manual page this does not happen. The script should just
> > run `man trans` instead of manually decoding the manual page and passing
> > the output to less.
> >
> > TRANS(1)                         TRANS MANUAL
> >  TRANS(1)
> >
> > ‐E .
> >
> > NAME
> >        ^LBtrans^LR - Google Translate served as a command-line tool
> >
> > SYNOPSIS
> >        ^LBtrans^LR [options] [source]:[target] [^LItext^LR] ...
> >
> >        ^LBtrans^LR [options] [source]:[target1]+[target2]+... [^LItext^LR]
> > ...
> >
> > -- System Information:
> > Debian Release: jessie/sid
> >   APT prefers testing
> >   APT policy: (900, 'testing'), (800, 'unstable'), (700, 'experimental')
> > Architecture: amd64 (x86_64)
> >
> > Kernel: Linux 3.16-2-amd64 (SMP w/4 CPU cores)
> > Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8)
> > Shell: /bin/sh linked to /bin/dash
> >
> > Versions of packages translate-shell depends on:
> > ii  gawk  1:4.1.1+dfsg-1
> >
> > Versions of packages translate-shell recommends:
> > pn  rlwrap  <none>
> >
> > Versions of packages translate-shell suggests:
> > pn  libfribidi-bin  <none>
> > ii  mplayer2        2.0-728-g2c378c7-2+b2
> >
> > -- no debconf information
> >
> > --
> > bye,
> > pabs
> >
> > https://wiki.debian.org/PaulWise
> >
> >
> >
> >
> > ----- End forwarded message -----
> >
> > --
> > http://fam-tille.de
> >

> From 5e3c7bc7492bd90e246c0177023230ff62f8784a Mon Sep 17 00:00:00 2001
> From: Mort Yao <mort....@gmail.com>
> Date: Fri, 26 Sep 2014 15:17:18 +0200
> Subject: [PATCH] remove man page from help
> 
> ---
>  build.awk        |    7 -------
>  include/Main.awk |    9 +--------
>  2 files changed, 1 insertion(+), 15 deletions(-)
> 
> diff --git a/build.awk b/build.awk
> index 0c49b52..9c62c1e 100755
> --- a/build.awk
> +++ b/build.awk
> @@ -61,13 +61,6 @@ function build(target,    group, inline, line, temp) {
>          print "EOF" > Trans
>          print "export TRANS_PROGRAM" > Trans
>  
> -        print "read -r -d '' TRANS_MANPAGE << 'EOF'" > Trans
> -        if (fileExists(Man))
> -            while (getline line < Man)
> -                print line > Trans
> -        print "EOF" > Trans
> -        print "export TRANS_MANPAGE" > Trans
> -
>          print "export COLUMNS" > Trans
>  
>          print "gawk \"$TRANS_PROGRAM\" - \"$@\"" > Trans
> diff --git a/include/Main.awk b/include/Main.awk
> index e58ead6..b136b8b 100644
> --- a/include/Main.awk
> +++ b/include/Main.awk
> @@ -84,14 +84,7 @@ BEGIN {
>          # -H, -h, -help
>          match(ARGV[pos], /^--?(h(e(lp?)?)?|H)$/)
>          if (RSTART) {
> -            if (ENVIRON["TRANS_MANPAGE"])
> -                system("echo -E \"${TRANS_MANPAGE}\" | " \
> -                       "groff -Wall -mtty-char -mandoc -Tutf8 -Dutf8 
> -rLL=${COLUMNS}n -rLT=${COLUMNS}n | " \
> -                       (system("most 2>/dev/null") ?
> -                        "less -s -P\"\\ \\Manual page " Command "(1) line 
> %lt (press h for help or q to quit)\"" :
> -                        "most -Cs"))
> -            else
> -                print getHelp()
> +            print getHelp()
>              exit
>          }
>  
> -- 
> 1.7.10.4
> 


-- 
http://fam-tille.de
>From 5e3c7bc7492bd90e246c0177023230ff62f8784a Mon Sep 17 00:00:00 2001
From: Mort Yao <mort....@gmail.com>
Date: Fri, 26 Sep 2014 15:17:18 +0200
Subject: [PATCH] remove man page from help

---
 build.awk        |    7 -------
 include/Main.awk |    9 +--------
 2 files changed, 1 insertion(+), 15 deletions(-)

diff --git a/build.awk b/build.awk
index 0c49b52..9c62c1e 100755
--- a/build.awk
+++ b/build.awk
@@ -61,13 +61,6 @@ function build(target,    group, inline, line, temp) {
         print "EOF" > Trans
         print "export TRANS_PROGRAM" > Trans
 
-        print "read -r -d '' TRANS_MANPAGE << 'EOF'" > Trans
-        if (fileExists(Man))
-            while (getline line < Man)
-                print line > Trans
-        print "EOF" > Trans
-        print "export TRANS_MANPAGE" > Trans
-
         print "export COLUMNS" > Trans
 
         print "gawk \"$TRANS_PROGRAM\" - \"$@\"" > Trans
diff --git a/include/Main.awk b/include/Main.awk
index e58ead6..b136b8b 100644
--- a/include/Main.awk
+++ b/include/Main.awk
@@ -84,14 +84,7 @@ BEGIN {
         # -H, -h, -help
         match(ARGV[pos], /^--?(h(e(lp?)?)?|H)$/)
         if (RSTART) {
-            if (ENVIRON["TRANS_MANPAGE"])
-                system("echo -E \"${TRANS_MANPAGE}\" | " \
-                       "groff -Wall -mtty-char -mandoc -Tutf8 -Dutf8 -rLL=${COLUMNS}n -rLT=${COLUMNS}n | " \
-                       (system("most 2>/dev/null") ?
-                        "less -s -P\"\\ \\Manual page " Command "(1) line %lt (press h for help or q to quit)\"" :
-                        "most -Cs"))
-            else
-                print getHelp()
+            print getHelp()
             exit
         }
 
-- 
1.7.10.4

Reply via email to