img



img

Pythonic-optparse


By: Kowh
Addon | img 187




Description

___________________________________________________________________________________________________________________________

  pythonic.optparse - Lua-based partial reimplementation of Python's
      optparse [2-3] command-line parsing module.

SYNOPSIS

  local Optparse = Apollo.GetPackage("Optparse-0.3").tPackage
  local opt = OptParse:OptionParser{usage="%prog [options] [...]",
                           version="foo 1.23", add_help_option=false}
  opt.add_option{"-h", "--help", action="store_true", dest="help",
                 help="give this help", default="default"}
  opt.add_option{
    "-f", "--force", dest="force", action="store_true",
    help="force overwrite of output file"}

  local options, args = opt.parse_args()

DESCRIPTION

  This library provides a command-line parsing[1] similar to Python optparse [2-3].

  Note: Python also supports getopt [4].

STATUS
 
  This module is fairly basic but could be expanded.
 
API

  See source code and also compare to Python's docs [2,3] for details because
  the following documentation is incomplete.
 
  opt = OptionParser {command=command, usage=usage, version=version,
    add_help_option=add_help_option, callback_write=callback_write}
 
    Create command line parser.

    callback_write: If provided, this function will be used for output instead of the command channel
    command: Name of the slash command
 
  opt.add_options{shortflag, longflag, action=action, metavar=metavar, dest=dest, help=help, default=default}
 
    Add command line option specification.  This may be called multiple times.
 
  opt.parse_args() --> options, args
 
    Perform argument parsing.
 
DEPENDENCIES

  None (other than Lua 5.1 or 5.2)




About Project

Created: December 15th 2023

Updated: December 15th 2023

Project ID: 83271

License: All Rights Reserved

__________________________________________

Game Versions:

1.01.03

1.01.03

1.01.03

1.01.03

1.01.03

__________________________________________

Flavors:

WoW Retail

__________________________________________

Categories

Companions

Battle

__________________________________________

Main File

Kowh_Pythonic-optparse.zip
  • Release
  • December 15th 2023

    __________________________________________

    Recent File

    Kowh_Pythonic-optparse.zip
  • Release
  • December 15th 2023

    __________________________________________

    Members

    img
    Kowh
    Owner

    __________________________________________

    Report