Skip to content

Commit 9741924

Browse files
authored
Merge pull request #1581 from istepic/available-places
Add list of available places
2 parents d35551c + 6a9901a commit 9741924

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

contrib/completion/labgrid-client.bash

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ _labgrid_client_r()
161161
162162
_labgrid_client_places()
163163
{
164-
_labgrid_client_generic_subcommand "--acquired --sort-last-changed"
164+
_labgrid_client_generic_subcommand "--acquired --released --sort-last-changed"
165165
}
166166
167167
_labgrid_client_p()

labgrid/remote/client.py

+3
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,8 @@ async def print_places(self):
375375
for name, place in places:
376376
if self.args.acquired and place.acquired is None:
377377
continue
378+
if self.args.released and place.acquired:
379+
continue
378380
if self.args.verbose:
379381
print(f"Place '{name}':")
380382
place.show(level=1)
@@ -1744,6 +1746,7 @@ def main():
17441746

17451747
subparser = subparsers.add_parser("places", aliases=("p",), help="list available places")
17461748
subparser.add_argument("-a", "--acquired", action="store_true")
1749+
subparser.add_argument("-r", "--released", action="store_true")
17471750
subparser.add_argument("--sort-last-changed", action="store_true", help="sort by last changed date (oldest first)")
17481751
subparser.set_defaults(func=ClientSession.print_places)
17491752

0 commit comments

Comments
 (0)