<div dir="ltr">btw, the name <font face="monospace, monospace">clik</font> is very close to another fairly well known and popular CLI package <font face="monospace, monospace">click</font> (from the creator of <font face="monospace, monospace">flask</font>): <a href="http://click.pocoo.org/">http://click.pocoo.org/</a><div><br></div><div>Anyway, thanks for developing and sharing <font face="monospace, monospace">clik</font>!</div><div><br></div><div>--Erik</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Dec 23, 2017 at 8:00 AM, Joe Joyce <span dir="ltr"><<a href="mailto:joe@decafjoe.com" target="_blank">joe@decafjoe.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Thomas,</div><div><br></div><div>Thank you for the quick feedback! It's exactly the sort of thing I was</div><div>looking for. I've been munching on it the last couple days, thoughts</div><div>below.</div><div><br></div><div>First -- duh. The instant I looked at the docs after reading your</div><div>message, I saw exactly what you're talking about. The links under</div><div>"Development" are documents about how to build/test/QA clik itself.</div><div>But that is not *at all* clear! (Unless, err... you happened to have</div><div>been the one who wrote that section like a month ago and haven't</div><div>thought about it much since....)</div><div><br></div><div>Second -- sigh. Quickstart/introductory documentation was/is a major</div><div>struggle with clik.</div><span class=""><div><br></div><div>> how do I make a --help option or how do I get a filename name as the</div><div>> first argument into a function that opens the file </div><div><br></div></span><div>For a real-world program the answer is "just use argparse" -- clik</div><div>provides nothing but an extra dependency to hassle with. clik doesn't</div><div>really start to help out until/unless the program is more complex</div><div>(namely: once it grows subcommands).</div><div><br></div><div>So I've felt that, to make a compelling case for clik, the example</div><div>code fundamentally has to be complex. That's why the tutorial is</div><div>thirteen friggin' steps, and 52m in screencast form.</div><div><br></div><div>But that's an unsatsifying answer. Expecting new users to make that</div><div>kind of investment of time and mental energy on a first-pass</div><div>evaluation is INSANE. </div><div><br></div><div>I'm not totally sure what the answer is. But you're right, I need to</div><div>bridge that gap.</div><div><br></div><div>Also, there is a more specific answer to your example question.</div><div>See below :).</div><div><br></div><div>import sys</div><div><br></div><div>from clik import app, args, parser</div><div><br></div><div><br></div><div>def do_a_thing_with_a_filename(<wbr>filename):</div><div>    pass</div><div><br></div><div><br></div><div>@app</div><div>def myapp():</div><div>    """</div><div>    This sentence and the next will be between the usage statement and</div><div>    the argument docs. If you're familiar with argparse, it's the</div><div>    ``description``.</div><div><br></div><div>    All the content after the first blank line is shown after the</div><div>    argument docs. In argparse terms, it's the ``epilog``. Note that</div><div>    argparse will reformat your documentation, so this is not</div><div>    a good place for things like examples that require formatting.</div><div>    """</div><div><br></div><div>    # Note: The -h/--help argument is automatically added by argparse.</div><div>    #       clik provides the ``name`` (for the usage statement),</div><div>    #       ``description`` and ``epilog`` to argparse. Description</div><div>    #       and epilog are taken from the function docstring, as</div><div>    #       described above. The ``name`` defaults to the function's</div><div>    #       name, but can be overridden by calling the decorator as</div><div>    #       follows: @app(name='other-name')</div><div><br></div><div>    parser.add_argument(</div><div>        '-f',</div><div>        '--filename',</div><div>        help='filename to pass to the function',</div><div>    )</div><div><br></div><div>    yield</div><div><br></div><div>    if args.filename is None:</div><div>        print('please provide a filename', file=sys.stderr)</div><div>        yield 1</div><div><br></div><div>    do_a_thing_with_a_filename(<wbr>args.filename)</div><div><br></div><div><br></div><div>if __name__ == '__main__':</div><div>    myapp.main()</div><div><br></div><div><br></div><div>Thanks again for your feedback!</div><span class="HOEnZb"><font color="#888888"><div>Joe</div><div><br></div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 20, 2017 at 11:25 AM, Thomas Winningham <span dir="ltr"><<a href="mailto:winningham@gmail.com" target="_blank">winningham@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">Very minor item from a quick look. The Quick start section seems to be about building the project. While exceptionally complete content, I was expecting something like a simplified version of the example code, say, how do I make a --help option or how do I get a filename name as the first argument into a function that opens the file.<div dir="auto"><br></div><div dir="auto">Otherwise, nicely done with having all the resources and such as the documentation and the package submission all ready to go. Pretty clean and clear!!</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_6497288487676370130h5">On Dec 20, 2017 9:23 AM, "Joe Joyce" <<a href="mailto:joe@decafjoe.com" target="_blank">joe@decafjoe.com</a>> wrote:<br type="attribution"></div></div><blockquote class="m_6497288487676370130m_-4475648846357130146quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_6497288487676370130h5"><div dir="ltr"><div>Hello all!</div><div><br></div><div>Long time listener, first time caller. Love the show :P.</div><div><br></div><div>So -- I built a thing. And if any of you have time over the holiday</div><div>break, I'd appreciate any feedback you have.</div><div><br></div><div>The code / docs are in the usual places:</div><div><br></div><div><a href="https://github.com/decafjoe/clik" target="_blank">https://github.com/decafjoe/cl<wbr>ik</a></div><div><a href="https://clik.readthedocs.io" target="_blank">https://clik.readthedocs.io</a></div><div><a href="https://pypi.python.org/pypi/clik" target="_blank">https://pypi.python.org/pypi/c<wbr>lik</a></div><div><br></div><div>There are two "levels" of feedback I'm looking for.</div><div><br></div><div>First, I've been in the forest so long on this thing that I'm not sure</div><div>whether the tutorial explains the concepts well, if at all. It all</div><div>makes sense to me, of course, but it's impossible for me to look at it</div><div>with a fresh set of eyes.</div><div><br></div><div>So -- not considering whether the library itself sucks -- does the</div><div>tutorial explain things well? Is the pace appropriate? Too much detail</div><div>/ too little?</div><div><br></div><div>Second, any feedback on the library itself is welcome. This is the</div><div>first "real" thing I've released into the world, but I'll try not to</div><div>be too sensitive! I'm curious (and a honestly a little afraid) about</div><div>what y'all will think.</div><div><br></div><div>Thanks, and happy holidays!</div><font color="#888888"><div>Joe</div><div><br></div></font></div>
<br></div></div>______________________________<wbr>_________________<br>
CentralOH mailing list<br>
<a href="mailto:CentralOH@python.org" target="_blank">CentralOH@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/centraloh" rel="noreferrer" target="_blank">https://mail.python.org/mailma<wbr>n/listinfo/centraloh</a><br>
<br></blockquote></div><br></div>
<br>______________________________<wbr>_________________<br>
CentralOH mailing list<br>
<a href="mailto:CentralOH@python.org" target="_blank">CentralOH@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/centraloh" rel="noreferrer" target="_blank">https://mail.python.org/mailma<wbr>n/listinfo/centraloh</a><br>
<br></blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
CentralOH mailing list<br>
<a href="mailto:CentralOH@python.org">CentralOH@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/centraloh" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/centraloh</a><br>
<br></blockquote></div><br></div>