Skip to content


Subversion checkout URL

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

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

    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
    	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 <>
  2. don't crash given semi-invalid optspecs.

    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 started in 2010.
    Signed-off-by: Avery Pennarun <>
Commits on Nov 4, 2011
  1. relicense to 2-clause BSD license.

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

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

    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 <>
  2. make --usage just print the usage message.

    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 <>
Commits on Jan 26, 2011
  1. generate usage string correctly for no-* options.

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

    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 <>
Commits on Sep 8, 2010
  1. get the real tty width for word wrapping purposes.

    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 <>
  2. remove extra newlines in usage string.

    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 <>
  3. handle optspecs that include inline square brackets.

    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 <>
  4. better support for explicit no-* options.

    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 <>
Commits on Jul 28, 2010
  1. support for putting default values in [square brackets].

    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 <>
Commits on Mar 21, 2010
  1. options: allow user to specify an alternative to getopt.gnu_getopt.

    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
Commits on Mar 3, 2010
  1. bup.options: remove reference to bup.helpers.

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

    ...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 to 'bup memtest' so that it
    can get the new paths automatically.
Something went wrong with that request. Please try again.