Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assemble help not fully printed #300

Open
waschik opened this issue Dec 19, 2024 · 5 comments
Open

Assemble help not fully printed #300

waschik opened this issue Dec 19, 2024 · 5 comments

Comments

@waschik
Copy link

waschik commented Dec 19, 2024

Hello assemble help is not fully printed in 90004b5.

$ echo $LANG
de_DE.UTF-8
$ tttool assemble
Missing: YAML

Usage: tttool assemble [--no-date] YAML [OUT]
  creates a gme file from the given source

Available options:
  --no-date                do not include todaytttool: <stderr>: hPutChar: invalid argument (invalid character)

Maybe use simple ascii:

diff --git a/src/tttool.hs b/src/tttool.hs
index 6a940c3..8c9671b 100644
--- a/src/tttool.hs
+++ b/src/tttool.hs
@@ -381,7 +381,7 @@ assembleCmd =
     noDate :: Parser Bool
     noDate = switch $ mconcat
         [ long "no-date"
-        , help "do not include today’s date in GME (useful for testing)"
+        , help "do not include today's date in GME (useful for testing)"
         ]
 
     outFileParser :: Parser (Maybe FilePath)

Then I have as output:

$ tttool assemble
Missing: YAML

Usage: tttool assemble [--no-date] YAML [OUT]
  creates a gme file from the given source

Available options:
  --no-date                do not include today's date in GME (useful for
                           testing)
  YAML                     Yaml file to read
  OUT                      GME file to write
  -h,--help                Show this help text
@nomeata
Copy link
Member

nomeata commented Dec 19, 2024

Not using unicode is of course an option :-)

Oddly, I don’t have that at problem. What's your system? Is this Windows?

Maybe I should just use with-utf8 here (https://serokell.io/blog/haskell-with-utf8)

@waschik
Copy link
Author

waschik commented Dec 19, 2024

I followed the Building.md (except keeping directory name as tip-toi-reveng) on Ubuntu Linux 20.04.

@nomeata
Copy link
Member

nomeata commented Dec 19, 2024

Hmm, interesting, I thought on Linux this isn’t really a problem any more these days. What does locale say? What is your terminal emulator?

@waschik
Copy link
Author

waschik commented Dec 19, 2024

I was able to reproduce this also with this Dockerfile (result is not so small because tttool links dynamicalls to /nix). Before I run without docker.

FROM ubuntu:20.04 AS builder

RUN \
    apt-get -y update \
    && apt-get -y upgrade \
    && apt-get -y install \
    curl \
    git \
    xz-utils \
    && rm -rf /var/lib/apt/lists/*

# required by nix profile
ENV USER=user

# creation of nix avoids later creation with not avaiable sudo command
RUN useradd -m "$USER" && \
    mkdir /app /nix && \
    chown "$USER" /app /nix

USER user

RUN cd /app && \
    git clone https://github.com/entropia/tip-toi-reveng.git && \
    cd tip-toi-reveng && \
    git reset --hard 90004b5ff6239d0635cf6029654374002dc034bd
WORKDIR /app/tip-toi-reveng

SHELL ["/bin/bash", "-c"]

# mkdir is workaround because sudo which would be used is not avaiable
RUN bash <(curl -L https://nixos.org/nix/install) && \
    . /home/user/.nix-profile/etc/profile.d/nix.sh && \
    nix-env -iA cachix -f https://cachix.org/api/v1/install && \
    cachix use tttool && \
    nix-build -A linux-exe && \
    cp -a result/bin/tttool .

#does not work because so files in /nix/store/lib/*.so are missing
#FROM ubuntu:20.04
#COPY --from=builder --chown=root:root /app/tip-toi-reveng/tttool /usr/local/bin/
USER root
RUN cp -a /app/tip-toi-reveng/tttool /usr/local/bin/ && \
    chown root:root /usr/local/bin/tttool

ENTRYPOINT ["/usr/local/bin/tttool"]
$ docker build -ttttool .
$ docker run --rm -it tttool assemble                                                                                                                                                                                                     
Missing: YAML

Usage: tttool assemble [--no-date] YAML [OUT]
  creates a gme file from the given source

Available options:
  --no-date                do not include todaytttool: <stderr>: hPutChar: invalid argument (invalid character)
$ echo $TERM
xterm-256color
$ locale
LANG=de_DE.UTF-8
LANGUAGE=
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER="de_DE.UTF-8"
LC_NAME="de_DE.UTF-8"
LC_ADDRESS="de_DE.UTF-8"
LC_TELEPHONE="de_DE.UTF-8"
LC_MEASUREMENT="de_DE.UTF-8"
LC_IDENTIFICATION="de_DE.UTF-8"
LC_ALL=
$ echo $'W\303\274rfel'
Würfel
$ docker run --rm -it --entrypoint= tttool locale
LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
$ docker run --rm -it --entrypoint= tttool bash -c 'echo "$TERM"'
xterm

@waschik
Copy link
Author

waschik commented Dec 19, 2024

I don't know I changed anything to terminal. I used standard terminal (gnome-terminal). The one you get with ctrl+alt+t.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants