From 15f34becbac54b644d63128eb5dfc472c8d16bda Mon Sep 17 00:00:00 2001 From: boyska Date: Tue, 25 Jan 2022 12:12:55 +0100 Subject: [PATCH] actually get command to run --- calippo.py | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/calippo.py b/calippo.py index 90ceefc..dce26a2 100755 --- a/calippo.py +++ b/calippo.py @@ -230,23 +230,38 @@ class Daemon(object): board.handler_unblock(event_id) - def parse_args(): """Parse command-line arguments.""" - parser = argparse.ArgumentParser(description='Clipster clipboard manager.') - parser.add_argument('-f', '--config', action="store", - help="Path to config directory.") - parser.add_argument('-l', '--log_level', action="store", default="INFO", - help="Set log level: DEBUG, INFO (default), WARNING, ERROR, CRITICAL") + parser = argparse.ArgumentParser(description="Clipster clipboard manager.") + parser.add_argument( + "-f", "--config", action="store", help="Path to config directory." + ) + parser.add_argument( + "-l", + "--log_level", + action="store", + default="INFO", + help="Set log level: DEBUG, INFO (default), WARNING, ERROR, CRITICAL", + ) - parser.add_argument("command", nargs='+') + parser.add_argument("command", nargs="+") # Mutually exclusive client and daemon options. boardgrp = parser.add_mutually_exclusive_group() - boardgrp.add_argument('-p', '--primary', action="store_const", const='PRIMARY', - help="Query, or write STDIN to, the PRIMARY clipboard.") - boardgrp.add_argument('-c', '--clipboard', action="store_const", const='CLIPBOARD', - help="Query, or write STDIN to, the CLIPBOARD clipboard.") + boardgrp.add_argument( + "-p", + "--primary", + action="store_const", + const="PRIMARY", + help="Query, or write STDIN to, the PRIMARY clipboard.", + ) + boardgrp.add_argument( + "-c", + "--clipboard", + action="store_const", + const="CLIPBOARD", + help="Query, or write STDIN to, the CLIPBOARD clipboard.", + ) return parser.parse_args()