Skip to content

Commit

Permalink
Add list of available places
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Stepic <[email protected]>
  • Loading branch information
Ivan Stepic authored and istepic committed Jan 27, 2025
1 parent f81f479 commit 06b414b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion contrib/completion/labgrid-client.bash
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ _labgrid_client_r()
_labgrid_client_places()
{
_labgrid_client_generic_subcommand "--acquired --sort-last-changed"
_labgrid_client_generic_subcommand "--acquired --available --sort-last-changed"
}
_labgrid_client_p()
Expand Down
3 changes: 3 additions & 0 deletions labgrid/remote/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,8 @@ async def print_places(self):
for name, place in places:
if self.args.acquired and place.acquired is None:
continue
elif self.args.available and place.acquired:
continue
if self.args.verbose:
print(f"Place '{name}':")
place.show(level=1)
Expand Down Expand Up @@ -1727,6 +1729,7 @@ def main():

subparser = subparsers.add_parser("places", aliases=("p",), help="list available places")
subparser.add_argument("-a", "--acquired", action="store_true")
subparser.add_argument("-l", "--available", action="store_true")
subparser.add_argument("--sort-last-changed", action="store_true", help="sort by last changed date (oldest first)")
subparser.set_defaults(func=ClientSession.print_places)

Expand Down

0 comments on commit 06b414b

Please sign in to comment.