Merge pull request #216 from pigmej/uids_fix-1

Fixed usage of `last` when no history file
This commit is contained in:
Łukasz Oleś 2015-10-01 15:24:29 +02:00
commit 51ba1dde80

View File

@ -65,7 +65,11 @@ class SolarUIDParameterType(click.types.StringParamType):
def convert(self, value, param, ctx):
value = click.types.StringParamType.convert(self, value, param, ctx)
value = get_uid(value)
try:
value = get_uid(value)
except IOError:
raise click.BadParameter("Unable to locate file %r so"
"you can't use 'last' shortcuts" % UIDS_HISTORY)
return value