Skip to content

Commit

Permalink
Merge pull request #5 from linux-automation/cfi/quiet
Browse files Browse the repository at this point in the history
main: Add quiet flag to command line interface
  • Loading branch information
SmithChart authored Feb 27, 2023
2 parents 0420ae2 + 78c3160 commit c856baf
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions usbmuxctl/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def status(args):
else:
if result["error"]:
_error_and_exit(f"Failed to connect to device: {result['errormessage']}")
else:
elif not args.quiet:
show_status(result["status"], args.raw)


Expand Down Expand Up @@ -270,7 +270,7 @@ def disconnect(args):
else:
if result["error"]:
_error_and_exit(f"Failed to set connection: {result['errormessage']}")
else:
elif not args.quiet:
show_status(result["status"], args.raw)


Expand Down Expand Up @@ -318,7 +318,7 @@ def connect(args):
else:
if result["error"]:
_error_and_exit(f"Failed to set connection: {result['errormessage']}")
else:
elif not args.quiet:
show_status(result["status"], args.raw)


Expand All @@ -345,7 +345,7 @@ def id(args):

if args.json:
print(json.dumps(result))
else:
elif not args.quiet:
if result["error"]:
_error_and_exit(f"Failed to connect to device: {result['errormessage']}")
else:
Expand All @@ -369,7 +369,7 @@ def dfu(args):
else:
if result["error"]:
_error_and_exit(f"Failed to connect to device: {result['errormessage']}")
else:
elif not args.quiet:
print("OK")


Expand Down Expand Up @@ -415,7 +415,7 @@ def software_update(args):
else:
if result["error"]:
_error_and_exit(result["errormessage"])
else:
elif not args.quiet:
print("OK")


Expand All @@ -428,6 +428,7 @@ def main():
format_parser.add_argument(
"--raw", help="Format output as raw info. Useful for command line scripting.", action="store_true"
)
format_parser.add_argument("--quiet", "-q", help="Make the tool less verbose.", action="store_true")

subparsers = parser.add_subparsers(help="Supply one of the following commands to interact with the USB-Mux")
subparsers.required = True
Expand Down

0 comments on commit c856baf

Please sign in to comment.