actually get command to run
This commit is contained in:
parent
bd29861999
commit
15f34becba
1 changed files with 26 additions and 11 deletions
37
calippo.py
37
calippo.py
|
@ -230,23 +230,38 @@ class Daemon(object):
|
||||||
board.handler_unblock(event_id)
|
board.handler_unblock(event_id)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def parse_args():
|
def parse_args():
|
||||||
"""Parse command-line arguments."""
|
"""Parse command-line arguments."""
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description='Clipster clipboard manager.')
|
parser = argparse.ArgumentParser(description="Clipster clipboard manager.")
|
||||||
parser.add_argument('-f', '--config', action="store",
|
parser.add_argument(
|
||||||
help="Path to config directory.")
|
"-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(
|
||||||
|
"-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.
|
# Mutually exclusive client and daemon options.
|
||||||
boardgrp = parser.add_mutually_exclusive_group()
|
boardgrp = parser.add_mutually_exclusive_group()
|
||||||
boardgrp.add_argument('-p', '--primary', action="store_const", const='PRIMARY',
|
boardgrp.add_argument(
|
||||||
help="Query, or write STDIN to, the PRIMARY clipboard.")
|
"-p",
|
||||||
boardgrp.add_argument('-c', '--clipboard', action="store_const", const='CLIPBOARD',
|
"--primary",
|
||||||
help="Query, or write STDIN to, the CLIPBOARD clipboard.")
|
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()
|
return parser.parse_args()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue