Git Product home page Git Product logo

watchall's Introduction

Currently this project is down ! I will rewrite this with go in near future

watchall

execute a program periodically, showing output fullscreen (watch) with scroll feature.

watchall's People

Contributors

mfatemipour avatar ptc0219 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

watchall's Issues

Crash when 200 or more lines

Exception in thread Thread-1:
  Traceback (most recent call last):
  File "/usr/lib64/python3.8/threading.py", line 932, in _bootstrap_inner  self.run()
                                                                                                                                                        File "/usr/lib64/python3.8/threading.py", line 870, in run
                 self._target(*self._args, **self._kwargs)
 File "/home/xk/.local/bin/watchall", line 85, in update_lines  self.refresh_screen(update_pad=True)
                                                                                                                                                                   File "/home/xk/.local/bin/watchall", line 120, in refresh_screen
       self.pad.addch(self.cur_output_lines[i][j])     _curses.error: add_wch() returned ERR

Flags in command

Hi there, it appears the package doesn't currently allow hyphens in command arguments.

For example:

python watchall.py squeue -u thejohnhoffer

prints a complaint from argparse that -u is not recognized.

I would expect this script to only use argparse on flags that precede the command, as it should pass the remaining arguments unaltered to the command. I believe I've found a solution that's the same in python 2 and 3:

Replace

parser.add_argument('Args', metavar='Arguments', type=str, nargs='*', help='Command arguments') 

with

parser.add_argument('Args', metavar='Arguments', type=str, nargs=argparse.REMAINDER, help='Command arguments') 

This is a stronger nargs='*' that also accepts flags untouched. I'm testing this now for my own application. Many thanks for writing a great package!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.