From 022578925b9d1cd3b771d43029df42e42b22aab0 Mon Sep 17 00:00:00 2001 From: Juergen Weigert Date: Mon, 11 Apr 2011 15:07:56 +0200 Subject: [PATCH] osc ls . (shortcut for PROJECT PACKAGE from current dir.) --- osc/commandline.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/osc/commandline.py b/osc/commandline.py index ff85f729..6dda2bec 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -236,6 +236,7 @@ class Osc(cmdln.Cmdln): Examples for listing sources: ls # list all projects (deprecated) ls / # list all projects + ls . # take PROJECT/PACKAGE from current dir. ls PROJECT # list packages in a project ls PROJECT PACKAGE # list source files of package of a project ls PROJECT PACKAGE # list if this file exists @@ -274,12 +275,19 @@ class Osc(cmdln.Cmdln): fname = None if len(args) == 0: # For consistency with *all* other commands - # this list what the server has in the current wd. + # this lists what the server has in the current wd. # CAUTION: 'osc ls -b' already works like this. pass if len(args) > 0: project = args[0] if project == '/': project = None + if project == '.': + cwd = os.getcwd() + if is_project_dir(cwd): + project = store_read_project(cwd) + elif is_package_dir(cwd): + project = store_read_project(cwd) + package = store_read_package(cwd) if len(args) > 1: package = args[1] if opts.deleted: