Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

An append action for argparse that overrides the default.

Project Description

Provides oappend action for argparse that works almost like append, but skips the default list if the user gives any value for the option.

See issue 16399 for a discussion.

Example

You may import OverrideAppendAction and register it with a parser or use the provided parser:

from oappend import OverrideAppendArgumentParser

parser = OverrideAppendArgumentParser()
parser.add_argument('-n', action='oappend', type=int, default=[1, 2])
args = parser.parse_args(['-n3', '-n4'])  # Namespace(n=[3, 4])

With the standard append action the option would be set to [1, 2, 3, 4], combining your default with user choices.

Installation

pip3 install argparse-oappend
Release History

Release History

This version
History Node

0.0.1

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
argparse-oappend-0.0.1.tar.gz (2.1 kB) Copy SHA256 Checksum SHA256 Source Jul 15, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting