有趣的小工具Boxes

題圖:來自網(wǎng)絡(luò)

boxes

Boxes is a command line program that draws a box around its input text. It can remove and repair those boxes, too. You can easily make your own box designs if you wish, but many designs are already provided.

boxex 是 linux 下的一款命令行工具,可以用字符組成盒子把你的文字包圍在里面。
就像下面這樣:

    Hello World!  ==>

     __________________
    /\                 \  
    \_|                |  
      |  Hello World!  |  
      |                |  
      |  ______________|_ 
      \_/_______________/
    
    
    /******************/
    /*                */
    /*  Hello World!  */
    /*                */
    /******************/
     
             \\\///
            / _  _ \
          (| (.)(.) |)
    .---.OOOo--()--oOOO.---.
    |                      |
    |     Hello World!     |
    |                      |
    '---.oooO--------------'
         (   )   Oooo.
          \ (    (   )
           \_)    ) /
                 (_/

安裝

Debiandebian-based, 如 Ubuntu, 還有 Windows 10 Ubuntu Subsystem,安裝都很簡(jiǎn)單,
只需要命令行執(zhí)行:

apt-get install boxes

使用

boxes --help 查看幫助。linux工具使用大法,先看幫助。

boxes -l 查看有多少可以使用的盒子格式。 已知有個(gè)叫dog的盒子模型。

輸入echo "I am testing" | boxes -d dog -a c 將生成:

          __   _,--="=--,_   __
         /  \."    .-.    "./  \
        /  ,/  _   : :   _  \/` \
        \  `| /o\  :_:  /o\ |\__/
         `-'| :="~` _ `~"=: |
            \`     (_)     `/
     .-"-.   \      |      /   .-"-.
.---{     }--|  /,.-'-.,\  |--{     }---.
 )  (_)_)_)  \_/`~-===-~`\_/  (_(_(_)  (
(             I am testing              )
 )                                     (
'---------------------------------------'

-d 參數(shù)表示選擇哪一個(gè)盒子模型,
-a 參數(shù)表示對(duì)齊方式。

自定義盒子模型

這個(gè)工具還支持自定義盒子模型。

我的使用方法

我配合boxes 寫了個(gè)vim插件,每次寫代碼的時(shí)候,就把這個(gè)狗頭放在我代碼的開頭

/* * 
 * @file 
 * @Brief  
 * @author                                                                                                                       
 * @version v1.0
 * @date 2016-10-31
 *
 *           __   _,--="=--,_   __
 *          /  \."    .-.    "./  \
 *         /  ,/  _   : :   _  \/` \
 *         \  `| /o\  :_:  /o\ |\__/
 *          `-'| :="~` _ `~"=: |
 *             \`     (_)     `/
 *      .-"-.   \      |      /   .-"-.
 * .---{     }--|  /,.-'-.,\  |--{     }---.
 *  )  (_)_)_)  \_/`~-===-~`\_/  (_(_(_)  (
 * (        0 Error(s) 0 Warning(s)        )
 *  )       xxxxxx Wang@xxxxxx            (
 * '---------------------------------------'            
 *                     
 */

是不是也挺有意思的。

其他

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容