Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add list of available places #1581

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 --released --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.released and place.acquired:
continue
if self.args.verbose:
print(f"Place '{name}':")
place.show(level=1)
Expand Down Expand Up @@ -1734,6 +1736,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", "--released", 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