Skip to content

Commit

Permalink
RLS Version 2.0.2
Browse files Browse the repository at this point in the history
Fixes the command line parsing bug introduced in 2.0.1
  • Loading branch information
luispedro committed Jun 11, 2020
1 parent 29164f7 commit ae43cb7
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 9 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Version 2.0.2 Thu Jun 11 2020 by luispedro
* Fix jug argument parsing

Version 2.0.1 Thu Jun 11 2020 by luispedro
* Fix handling of `JUG_EXIT_IF_FILE_EXISTS` environmental variable
* Fix passing an argument to jug.main() function
Expand Down
3 changes: 3 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ the `value` function::
What's New
----------

Version 2.0.2 (Thu Jun 11 2020)

- Fix command line argument parsing

Version 2.0.1 (Thu Jun 11 2020)

Expand Down
10 changes: 10 additions & 0 deletions docs/source/history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
History
=======

Version 2.0.2
-------------

*Released Thu Jun 11 2020*

Bugfixes
~~~~~~~~

- Fix command line argument parsing

Version 2.0.1
-------------

Expand Down
3 changes: 2 additions & 1 deletion jug/jug.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ def main(argv=None):
from .options import parse
if argv is None:
from sys import argv
options = parse(argv)
# The interface to `parse` requires us to skip the first element:
options = parse(argv[1:])
jugspace = None
store = None

Expand Down
2 changes: 1 addition & 1 deletion jug/jug_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '2.0.1'
__version__ = '2.0.2'
CITATION = '''\
Coelho, L.P., (2017). Jug: Software for Parallel Reproducible Computation in
Python. Journal of Open Research Software. 5(1), p.30.
Expand Down
13 changes: 6 additions & 7 deletions jug/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,14 @@ def parse(args=None, optionsfile=None):
'''
import argparse
from .subcommands import cmdapi
import sys

if args is None:
if len(sys.argv) <= 1:
cmdapi.usage()
# If reading from sys.argv, argparse discards the first argument
# Since we filter sys.argv manually, we do the same here
args = sys.argv[1:]
if not args:
cmdapi.usage()

parser = argparse.ArgumentParser(
description=cmdapi.usage(_print=False, exit=False),
Expand All @@ -240,11 +244,6 @@ def parse(args=None, optionsfile=None):
define_options(sub)
sub.add_argument('user_args', nargs='*', default=[])

if args is None:
# If reading from sys.argv, argparse discards the first argument
# Since we filter sys.argv manually, we do the same here
args = sys.argv[1:]

argopts = parser.parse_args(args)

inifile = read_configuration_file(optionsfile, default_options=default_options)
Expand Down

0 comments on commit ae43cb7

Please sign in to comment.