Python Forum
i need a module for more involved command line parsing
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
i need a module for more involved command line parsing
#15
(Aug-30-2019, 03:59 AM)Skaperen Wrote: line 11 is @click.argument('arg', nargs=-1). where do those 2 "arguments" go?
All is good document in Click Variadic Arguments .
Click doc Wrote:This can be controlled with the nargs parameter. If it is set to -1, then an unlimited number of arguments is accepted.

skapren Wrote:telling me that a decorator does make changes is not telling me how i could make use of the feature in my own programming
If want to learn decorate then use tutorial/books it's a lot written about it,it's not the goal of Click to learn user decorator.
This is the goal,decorator help with "as little code as necessary" for users.
Click doc Wrote:Click is a Python package for creating beautiful command line interfaces in a composable way with as little code as necessary


Skaperen Wrote:do you know how to write a decorator function?
Did write one one in post #5,just as an easy example to understand.
Also if write a more robust version that meant to be used be other would also used @functools.wraps.
Or better wrapt.
This so metadata/signature of function eg __module__, __name__, __qualname__, __doc__, and __annotations__,don't get lost.

I am finish with this Thread now Hand ,the whole point was in post #2 to give a advice that i think Click is okay for these tasks.
Reply


Messages In This Thread
RE: i need a module for more involved command line parsing - by snippsat - Aug-30-2019, 02:02 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  module either imported by a command or itself run as a command Skaperen 2 718 Dec-04-2023, 03:15 AM
Last Post: Skaperen
  review of command line parsers Skaperen 2 2,162 Mar-11-2021, 07:39 PM
Last Post: Skaperen
  command line options Skaperen 5 2,784 Aug-14-2020, 08:48 AM
Last Post: DeaD_EyE
  opening python from the command line takes a long time to load? abdulkaderanwar 4 3,177 Jun-22-2020, 03:42 AM
Last Post: abdulkaderanwar
  f-string in command line arguments Skaperen 0 1,695 May-05-2020, 11:49 PM
Last Post: Skaperen
  my own command line option parser Skaperen 0 1,714 Mar-27-2020, 04:14 AM
Last Post: Skaperen
  want suggested module for e-mail parsing Skaperen 0 1,596 Jul-26-2019, 08:52 PM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020