noctuid / zscroll

A text scroller for panels or terminals
GNU General Public License v3.0
201 stars 10 forks source link

Executing command results in showing help page (NixOS) #11

Closed takedawilliam closed 3 years ago

takedawilliam commented 3 years ago

I open a new shell with zscroll by executing the following command

nix-shell -p zscroll

Then, I try running the following command

zscroll "$(mpc current)"

Instead of returning some results, it shows the help page

[nix-shell:~/.config/nixpkgs]$ zscroll "$(mpc current)"
usage: zscroll [-h] [-l LENGTH] [-b BEFORETEXT] [-a AFTERTEXT] [-p SCROLLPADDING] [-d DELAY] [-s SCROLL] [-m MATCHTEXT] [-M MATCHCOMMAND] [-u] [-n]
               [-c] [-f]
               [scrolltext]

positional arguments:
  scrolltext            text to scroll; will print in place if not longer than scroll length; can be read from stdin, e.g. 'echo text | zscroll'

optional arguments:
  -h, --help            show this help message and exit
  -l LENGTH, --length LENGTH
                        length of scrolling text not including left and right padding text (default: 40)
  -b BEFORETEXT, --beforetext BEFORETEXT
                        stationary padding text to be displayed to the left of the scrolling text (default: "")
  -a AFTERTEXT, --aftertext AFTERTEXT
                        stationary padding text to be displayed to the right of the scrolling text (default: "")
  -p SCROLLPADDING, --scrollpadding SCROLLPADDING
                        paddingtext to be displayed between the start and end of thetext only when it is scrolling (default: " - ")
  -d DELAY, --delay DELAY
                        second delay for scrolling update; lower for faster scrolling (default: 0.4)
  -s SCROLL, --scroll SCROLL
                        set to 0 to always prevent scrolling; meant to be used with -g (default: 1)
  -m MATCHTEXT, --matchtext MATCHTEXT
                        regexp to search for in matchcommand output to determine whether to change settings (default: none)
  -M MATCHCOMMAND, --matchcommand MATCHCOMMAND
                        command(s) to search output of (default: none)
  -u, --updatecheck     specifies that the positional argument is a command that should be checked to determine if the scroll text should be updated
                        (default: no)
  -n, --newline         print a newline after each update (default: no)
  -c, --characterlength
                        count length by characters instead of considering fullwidth characters to be length 2 (default: no)
  -f, --fullwidth       if fullwidth characters are found in the text, convert all characters to be fullwidth (default: no)

[nix-shell:~/.config/nixpkgs]$

I don't know what happened here. Could you please help?

takedawilliam commented 3 years ago

If I use zscroll -u true $(mpc current), it works

It looks like -u is a compulsory option

takedawilliam commented 3 years ago

Alright, I figured it out

The problem lies in how to use -u option

The correct way to use it is

zscroll -u "mpc current"