Giter Site home page Giter Site logo

optex-pingu's Introduction

Actions Status MetaCPAN Release

NAME

pingu - optex make-everything-pingu filter

SYNOPSIS

optex -Mpingu --pingu command

DESCRIPTION

This optex module is greatly inspired by pingu(1) command and make every command pingu not only ping(1). As for original command, see "SEE ALSO" section. All honor for this idea should go to the original author.

This module is a quite good example to demonstrate optex(1) command features.

OPTION

  • --pingu

    Make command pingu.

  • --pingu-image=file

    Set image file. File is searched at current directory and module directory. Standard pingu image is stored as pingu.asc. If string pingu is specified, module search the file in the following order.

      ./pingu
      ./pingu.asc
      module-dir/pingu
      module-dir/pingu.asc
    
  • --pingu-char

    Specify replacement character. Default is Unicode FULL BLOCK (U+2588: โ–ˆ).

  • --pingu-interval=sec

    Set interval time between printing each lines. Default is zero.

IMAGE FILE FORMAT

  • ASCII

    Each [RGBCMYWKrgbcmywk] character is converted to specified letter with color which the character itself describe. Upper-case character represent normal ANSI color and lower-case means high-intensity color.

      R  r  Red
      G  g  Green
      B  b  Blue
      C  c  Cyan
      M  m  Magenta
      Y  y  Yellow
      K  k  Black
      W  w  White
    

    Line start with # is treated as a comment.

    Default pingu image:

       ...        .     ...   ..    ..     .........           
       ...     ....          ..  ..      ... .....  .. ..      
       ...    .......      ...         ... . ..... kkkkkkk     
      .....  ........ .kkkkkkkkkkkkkkk.....  ... kkkkkkkkkk.  .
       .... ........kkkkkkkkkkkkkkkkkkkkk.  ... kkkkkkkkkkk    
            ....... kkwwwwkkkkkkkkkkkkkkkk.... kkkkkkkkkkkk    
      .    .  .... kkwwkkwwkkkkkkkkkkwwwwkk... kkkkkkkkkkk     
         ..   ....kkkkwwwwkkrrrrrrkkwwkkwwk.. .kkkkkkkkkkk     
          .       kkkkkkkkrrrrrrrrrrkwwwwkk.   .kkkkkkkkkk     
         ....     .kkkkkkkkrrrrrrrrkkkkkkkk.      kkkkkkkk     
        .....      .  kkkkkkkkkkkkkkkkkkkk.        kkkkkkk.    
      ......     .. . kkkkkkkkkkkkkkkkkk . .      .kkkkkkk     
      ......       kkkkkkkkkkkkkkkkkkkkk  .      .kkkkkkk      
      ......   .kkkkkkkkkkkkkkkkkkyywwkkkkk  ..  kkkkkkk       
      ...    . kkkkkkkkkkkkkkkkywwwwwwwwwkkkkkkkkkkkkkk.       
             kkkkkkkkkkkkkkkkywwwwwwwwwwwwwkkkkkkkkk .         
            kkkkkkkkkkkkkkkywwwwwwwwwwwwwwwwkk    .            
           kkkkkkkkkkkkkkkywwwwwwwwwwwwwwwwwww  ........       
        .kkkkkkkkkkkkkkkkywwwwwwwwwwwwwwwwwwww    .........    
       .kkkkkkkkkkkkkkkkywwwwwwwwwwwwwwwwwwwwww       .... . . 
    

Other file format is not supported yet.

Coloring is done by Getopt::EX::Colormap module. See its document for detail.

INSTALL

Use cpanminus(1) command:

cpanm App::optex::pingu

PINGU ALIAS

You can set shell alias pingu to call ping(1) command through optex.

alias pingu='optex -Mpingu --pingu ping'

However, there is more sophisticated way to use optex alias function. Next command will make symbolic link pingu->optex in ~/.optex.d/bin directory:

$ optex --ln pingu

Executing this symbolic link, optex will call system installed pingu command. So make an alias in ~/.optex.d/config.toml to call ping(1) command instead:

[alias]
    pingu = "ping -Mpingu --pingu"

MAKING NEW PING OPTION

You can add, say, --with-pingu option to the original ping(1) command. Make a symbolic link ping->optex in ~/.optex.d/bin directory:

$ optex --ln ping

And create an rc file ~/.optex.d/ping.rc for ping:

option --with-pingu -Mpingu --pingu

Then pingu will show up when you use --with-pingu option to execute ping(1) command:

$ ping --with-pingu localhost -c15

If you want to enable this option always (really?), put next line in your ~/.optex.d/ping.rc:

option default --with-pingu

SEE ALSO

https://github.com/sheepla/pingu

App::optex, https://github.com/kaz-utashiro/optex/

App::optex::pingu, https://github.com/kaz-utashiro/optex-pingu/

AUTHOR

Kazumasa Utashiro

LICENSE

Copyright 2022 Kazumasa Utashiro.

You can redistribute it and/or modify it under the same terms as Perl itself.

optex-pingu's People

Contributors

kaz-utashiro avatar

Stargazers

Okawa Yusuke avatar sheepla avatar

Watchers

James Cloos avatar  avatar

optex-pingu's Issues

Tests have started to fail

Sample fail report: http://www.cpantesters.org/cpan/report/dff091a4-0f78-11ed-b078-c423c0b3760d

I've reproduced the fail report by picking a perl that had a PASS report and then upgrading File::Share to INGY/File-Share-0.26.tar.gz

After that upgrade the test failed.

The two reports before/after: http://www.cpantesters.org/cpan/report/1a64e0c8-0f89-11ed-ad5b-8ac72b549893 http://www.cpantesters.org/cpan/report/50924d70-0f89-11ed-8503-7bca2b549893

@ingydotnet , can you have a look?

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.