diff options
-rwxr-xr-x | contrib/sort.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/contrib/sort.py b/contrib/sort.py index 5cd4045f0..388a29710 100755 --- a/contrib/sort.py +++ b/contrib/sort.py | |||
@@ -2,7 +2,7 @@ | |||
2 | # This file is part of Firejail project | 2 | # This file is part of Firejail project |
3 | # Copyright (C) 2014-2022 Firejail Authors | 3 | # Copyright (C) 2014-2022 Firejail Authors |
4 | # License GPL v2 | 4 | # License GPL v2 |
5 | """ | 5 | """\ |
6 | Sort the arguments of commands in profiles. | 6 | Sort the arguments of commands in profiles. |
7 | 7 | ||
8 | Usage: ./sort.py [/path/to/profile ...] | 8 | Usage: ./sort.py [/path/to/profile ...] |
@@ -25,6 +25,7 @@ Examples: | |||
25 | Exit Codes: | 25 | Exit Codes: |
26 | 0: Success: No profiles needed fixing. | 26 | 0: Success: No profiles needed fixing. |
27 | 1: Error: One or more profiles could not be processed correctly. | 27 | 1: Error: One or more profiles could not be processed correctly. |
28 | 2: Error: Missing arguments. | ||
28 | 101: Info: One or more profiles were fixed. | 29 | 101: Info: One or more profiles were fixed. |
29 | """ | 30 | """ |
30 | 31 | ||
@@ -94,8 +95,13 @@ def fix_profile(filename): | |||
94 | 95 | ||
95 | 96 | ||
96 | def main(args): | 97 | def main(args): |
97 | exit_code = 0 | 98 | if len(args) < 1: |
99 | print(__doc__, file=stderr) | ||
100 | return 2 | ||
101 | |||
98 | print(f"sort.py: checking {len(args)} profile(s)...") | 102 | print(f"sort.py: checking {len(args)} profile(s)...") |
103 | |||
104 | exit_code = 0 | ||
99 | for filename in args: | 105 | for filename in args: |
100 | try: | 106 | try: |
101 | if exit_code not in (1, 101): | 107 | if exit_code not in (1, 101): |