Skip to content

Commit

Permalink
sort.py: print usage if there are no arguments
Browse files Browse the repository at this point in the history
Escape the first line in the docstring to avoid printing a blank line as
the first line of the output.
  • Loading branch information
kmk3 committed Oct 19, 2022
1 parent 9bf4912 commit 63b2857
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions contrib/sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is part of Firejail project
# Copyright (C) 2014-2022 Firejail Authors
# License GPL v2
"""
"""\
Sort the arguments of commands in profiles.
Usage: ./sort.py [/path/to/profile ...]
Expand Down Expand Up @@ -94,8 +94,13 @@ def fix_profile(filename):


def main(args):
exit_code = 0
if len(args) < 1:
print(__doc__, file=stderr)
return

print(f"sort.py: checking {len(args)} profile(s)...")

exit_code = 0
for filename in args:
try:
if exit_code not in (1, 101):
Expand Down

0 comments on commit 63b2857

Please sign in to comment.