Metadata-Version: 1.0
Name: miniparser
Version: 1.0.7.1
Summary: minimum commandline option parser.
Home-page: http://github.com/alice1017
Author: alice1017
Author-email: takemehighermore@gmail.com
License: MIT
Download-URL: http://github.com/alice1017/miniparser
Description: What's miniparser?
        ##################
        
        The **miniparser** is minimum commandline option parser.
        
        miniparser can use easily.
        This is a library for people that think argparse or optparse is difficult.
        
        How to use
        -----------
        
        ::
        
            #!/usr/bin/env python
            #coding: utf-8
        
            import miniparser
        
            parser = miniparser.parser(version="1.0")
        
            @parser.default(description="show license.")
            def show_license():
                print "License : MIT"
        
            @parser.option("-m","msg","--message","--msg", description="this is help msg.", argument_types={"msg":str,"count":int})
            def printer(msg, count):
                print msg*count
        
            @parser.option("-p","plus","--plus", description="plus number.", argument_types={"num1":int,"num2":int})
            def calc(num1, num2):
                print num1+num2
        
            if __name__ == "__main__":
                parser.parse()
        
        Help message
        
        ::
        
            parser.normal.test.py var.1.0  - miniparser test script
        
            $ parser.normal.test.py [[OPTIONS]]
            If you not set option : show license.
            ------------------------------
            OPTIONS :
               -m, msg, --message, --msg [[msg], [count]]
                  this is help msg.
        
               -p, plus, --plus [[num1], [num2]]
                  plus number.
        
               -h, --help, help
                  Show this usage message.
        
               -v, --version, version
                  Show this application version.
        
        First, import script.
        ^^^^^^^^^^^^^^^^^^^^^^
        
            import miniparser
        
        Second, create parser instance.
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        
            parser = miniparser.parser()
        
        Third, define optin.
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
        
        Miniparser use **decorator** to defininig option.
        
        The arguments of decorator
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~
        
        hooks
            The option hook. write option name as you like. You can set multiple but cannot duplicate.
        
        description
            The description of option.
        
        argument_types
            You can set types about argument of option. this is only required dictionary that {'argument_name':'argument_type'}.
        
        Forth, Parsing
        ^^^^^^^^^^^^^^^^
        
            parser.parse()
        
        That's only!
        
        Install
        ---------
        
        ::
        
            git clone git://github.com/alice1017/miniparser.git
            cd miniparser
            python setup.py build install
        
        or
        
        ::
        
            easy_install miniparser
        
        
        This is opensource.
        ----------------------
        
        You can see source code on `Github <https://github.com/alice1017/miniparser>`_ .
        
        License is MIT License.
        
        ChangeLog
        -------------
        
        :ver 1.0.0: 正式リリース。  
        :ver 1.0.1: option定義時のhooksが重複していたらエラーが出るようになりました  
        :ver 1.0.2: option定義時にargument_typesという{引数名:型}このような辞書オブジェクトを指定すると、関数が起動したときにチェックしてくれようになりました。
        :ver 1.0.3: argument_typesを指定していないときにエラーが発生するバグをfixed.
        :ver 1.0.5: `command` オブジェクトを追加。フックを必要とせず、何も引数が無い状態で起動した場合の挙動を設定できるようになりました。
        :ver 1.0.5.1: フックを必要としないオプションの名前を `command` から `DefaultOption` に変更。違和感なし
        :ver 1.0.6: 以前はできなかったフックの要らないオプション、すなわち `DefaultOption` に引数を取って実行することができるようになった。
        :ver 1.0.6a: `DefaultOption` の引数に関するバグをFixed.
        :ver 1.0.7: 正式に `DefaultOption` のバグなしの稼働ができるようになりました。
        ;ver 1.0.7.1: `DefaultOption` を使用しなかった場合はすべてヘルプを表示して終了してしまうバグをfixしました。
        
        
        Author
        ----------
        
        author name is 'Alice'.
        
        * Twitter id : alice1017
        * github id  : alice1017
        
        Thank you!
        
        
Platform: UNKNOWN
