All Projects → piranha → opster

piranha / opster

Licence: other
Command line parsing speedster

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects
shell
77523 projects

Projects that are alternatives of or similar to opster

Clikt
Multiplatform command line interface parsing for Kotlin
Stars: ✭ 1,658 (+3088.46%)
Mutual labels:  command-line-parser
Clime
⌨ The command-line interface framework for TypeScript.
Stars: ✭ 225 (+332.69%)
Mutual labels:  command-line-parser
opzioni
The wanna-be-simplest command line arguments library for C++
Stars: ✭ 29 (-44.23%)
Mutual labels:  command-line-parser
Spectre.cli
An extremely opinionated command-line parser.
Stars: ✭ 121 (+132.69%)
Mutual labels:  command-line-parser
Commander
🚀The framework to write type-safe and structured command line program easily in Swift.
Stars: ✭ 170 (+226.92%)
Mutual labels:  command-line-parser
Konfig
Simple config properties API for Kotlin
Stars: ✭ 249 (+378.85%)
Mutual labels:  command-line-parser
Conf
Go package for loading program configuration from multiple sources.
Stars: ✭ 70 (+34.62%)
Mutual labels:  command-line-parser
argparser
Simple command-line parser for C/C++ programs
Stars: ✭ 50 (-3.85%)
Mutual labels:  command-line-parser
Argagg
A simple C++11 command line argument parser
Stars: ✭ 180 (+246.15%)
Mutual labels:  command-line-parser
argparse dataclass
Declarative CLIs with argparse and dataclasses
Stars: ✭ 30 (-42.31%)
Mutual labels:  command-line-parser
Typin
Declarative framework for interactive CLI applications
Stars: ✭ 126 (+142.31%)
Mutual labels:  command-line-parser
Co
Art of C++. Flag, logging, unit-test, json, go-style coroutine and more.
Stars: ✭ 2,264 (+4253.85%)
Mutual labels:  command-line-parser
Argumentparser
Faster, easier, more declarative parsing of command line arguments in Objective-C/Foundation.
Stars: ✭ 251 (+382.69%)
Mutual labels:  command-line-parser
Programoptions.hxx
Single-header program options parsing library for C++11
Stars: ✭ 112 (+115.38%)
Mutual labels:  command-line-parser
args
Simple and type-safe commandline argument parser for C++14
Stars: ✭ 63 (+21.15%)
Mutual labels:  command-line-parser
Ppx deriving cmdliner
Ppx_deriving plugin for generating command line interfaces from types (Cmdliner.Term.t)
Stars: ✭ 78 (+50%)
Mutual labels:  command-line-parser
Cli Matic
Compact, hands-free [sub]command line parsing library for Clojure.
Stars: ✭ 245 (+371.15%)
Mutual labels:  command-line-parser
jbock
Reflectionless command line parser
Stars: ✭ 73 (+40.38%)
Mutual labels:  command-line-parser
config-cpp
C++ Configuration management library inspired by the Viper package for golang.
Stars: ✭ 21 (-59.62%)
Mutual labels:  command-line-parser
command-line-commands
Add a git-like command interface to your app.
Stars: ✭ 40 (-23.08%)
Mutual labels:  command-line-parser

Opster

Opster is a command line options parser, intended to make writing command line applications easy and painless. It uses built-in Python types (lists, dictionaries, etc) to define options, which makes configuration clear and concise. Additionally it contains possibility to handle subcommands (i.e. hg commit or svn update).

https://secure.travis-ci.org/piranha/opster.png

Supported Python versions: Python >= 2.6 (including 3.x)

Quick example

That's an example of an option definition

import sys
from opster import command

@command()
def main(message,
         no_newline=('n', False, "don't print a newline")):
    '''Simple echo program'''
    sys.stdout.write(message)
    if not no_newline:
        sys.stdout.write('\n')

if __name__ == '__main__':
    main.command()

Running this program will print help message:

> ./echo.py
echo.py: invalid arguments
echo.py [OPTIONS] MESSAGE

Simple echo program

options:

 -n --no-newline  don't print a newline
 -h --help        show help

As you can see, here we have defined option to not print newline: keyword argument name is a long name for option, default value is a 3-tuple, containing short name for an option (can be empty), default value (on base of which processing is applied - see description) and a help string.

Underscores in long names of options are converted into dashes.

If you are calling a command with option using long name, you can supply it partially. In this case it could look like ./echo.py --no-new. This is also true for subcommands: read about them and everything else you'd like to know in documentation.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].