Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Commits on Mar 20, 2012
  1. options.py: get rid of end-of-line whitespace.

    authored
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
Commits on Mar 19, 2012
  1. options.py: clean up handling of --no-* options.

    authored
    The particular bug that triggered this (in a project other than bup) was of
    the form:
    
    	n,no-stupid       don't be stupid
    
    Where it would actually end up setting stupid=1 by accident, and -n would
    mean --stupid, not --no-stupid.  As part of fixing it, you can now also do
    this:
    
    	n,no-stupid,smart   don't be stupid (ie. be smart)
    
    and it'll work as it should: n == smart == no-stupid == not stupid.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
  2. options.py: don't crash given semi-invalid optspecs.

    authored
    It's kind of weird to provide an argument without a description, but it's
    not crash-worthy (especially when the crash was a totally unhelpful
    exception stack trace).  While we're here, test for a couple of other ones
    that didn't cause a crash, but we want to keep it that way.
    
    And fix the copyright message; actually options.py started in 2010.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
Commits on Nov 4, 2011
  1. options.py: relicense to 2-clause BSD license.

    authored
    At the request of a few people who would like to us it in their own
    projects.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
Commits on May 15, 2011
  1. options.py: add support for '-#' style compression options.

    authored
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
Commits on Feb 20, 2011
  1. options.py: o.fatal(): print error after, not before, usage message.

    authored
    git prints the error *before* the usage message, but the more I play with
    it, the more I'm annoyed by that behaviour.  The usage message can be pretty
    long, and the error gots lost way above the usage message.  The most
    important thing *is* the error, so let's print it last.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
  2. options.py: make --usage just print the usage message.

    authored
    This is a relatively common option in other programs, so let's make it work
    in case someone tries to use it.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
Commits on Jan 26, 2011
  1. options.py: generate usage string correctly for no-* options.

    authored
    (copied from the sshuttle project)
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
  2. options.py: don't die if tty width is set to 0.

    authored
    This sometimes happens if weird people, such as myself, open a pty without
    setting the width field correctly.
    
    (copied from the sshuttle project)
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
Commits on Sep 8, 2010
  1. options.py: get the real tty width for word wrapping purposes.

    authored
    Previously we just assumed it was 70 chars, which was safe enough, but not
    as elegant as actually reading the real value and adjusting the word wrap of
    the usage string accordingly.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
  2. options.py: remove extra newlines in usage string.

    authored
    If the first line after the "--" was a comment (started with whitespace),
    then we'd end up printing a double newline instead of a single one after the
    synopsis string.
    
    It would also look weird if we had a multi-line comment; the lines would be
    separated by blank lines.
    
    'bup damage -?' encountered this problem.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
  3. options.py: handle optspecs that include inline square brackets.

    authored
    We recently made it so if the last thing on an options line was [defval],
    then the value in brackets became the default for that option.  However, we
    inadvertently matched *any* bracketed value on that line, not just the one
    at the end of the line, which basically prevents us from using square
    brackets anywhere on the line.  That's no fun.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
  4. options.py: better support for explicit no-* options.

    authored
    If a declared option name starts with no-xxx, then the 'xxx' option starts
    off set to True by default, so that no-xxx is False by default, so that
    passing --no-xxx as an option will have the desired effect of setting
    --no-xxx=True (and thus --xxx=False).
    
    Previously, trying to list a --no-xxx option in the argument list would
    trigger an assertion failure.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
Commits on Jul 28, 2010
  1. options.py: support for putting default values in [square brackets].

    authored
    This looks good in the usage message, and is a better place to hardcode such
    things than in the code itself.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
Commits on Mar 21, 2010
  1. options: allow user to specify an alternative to getopt.gnu_getopt.

    authored
    The most likely alternative is getopt.getopt, which doesn't rearrange
    arguments.  That would mean "-a foo -p" is considered as the option "-a"
    followed by the non-option arguments ['foo', '-p'].
    
    The non-gnu behaviour is annoying most of the time, but can be useful when
    you're receiving command lines that you want to pass verbatim to someone
    else.
Commits on Mar 3, 2010
  1. bup.options: remove reference to bup.helpers.

    authored
    This makes the module more easily reusable in other apps.
Commits on Feb 28, 2010
  1. Move python library files to lib/bup/

    authored
    ...and update other programs so that they import them correctly from their
    new location.
    
    This is necessary so that the bup library files can eventually be installed
    somewhere other than wherever the 'bup' executable ends up.  Plus it's
    clearer and safer to say 'from bup import options' instead of just 'import
    options', in case someone else writes an 'options' module.
    
    I wish I could have named the directory just 'bup', but I can't; there's
    already a program with that name.
    
    Also, in the name of sanity, rename memtest.py to 'bup memtest' so that it
    can get the new paths automatically.
Something went wrong with that request. Please try again.