|
2 | 2 | # This file is part of Firejail project
|
3 | 3 | # Copyright (C) 2014-2022 Firejail Authors
|
4 | 4 | # License GPL v2
|
5 |
| -"""\ |
| 5 | + |
| 6 | +# Requirements: |
| 7 | +# python >= 3.6 |
| 8 | +from os import path |
| 9 | +from sys import argv, exit as sys_exit, stderr |
| 10 | + |
| 11 | +__doc__ = f"""\ |
6 | 12 | Sort the arguments of commands in profiles.
|
7 | 13 |
|
8 |
| -Usage: ./sort.py [/path/to/profile ...] |
| 14 | +Usage: {path.basename(argv[0])} [/path/to/profile ...] |
9 | 15 |
|
10 | 16 | The following commands are supported:
|
11 | 17 |
|
|
17 | 23 | Keep in mind that this will overwrite your profile(s).
|
18 | 24 |
|
19 | 25 | Examples:
|
20 |
| - $ ./sort.py MyAwesomeProfile.profile |
21 |
| - $ ./sort.py new_profile.profile second_new_profile.profile |
22 |
| - $ ./sort.py ~/.config/firejail/*.{profile,inc,local} |
23 |
| - $ sudo ./sort.py /etc/firejail/*.{profile,inc,local} |
| 26 | + $ {argv[0]} MyAwesomeProfile.profile |
| 27 | + $ {argv[0]} new_profile.profile second_new_profile.profile |
| 28 | + $ {argv[0]} ~/.config/firejail/*.{{profile,inc,local}} |
| 29 | + $ sudo {argv[0]} /etc/firejail/*.{{profile,inc,local}} |
24 | 30 |
|
25 | 31 | Exit Codes:
|
26 | 32 | 0: Success: No profiles needed fixing.
|
|
29 | 35 | 101: Info: One or more profiles were fixed.
|
30 | 36 | """
|
31 | 37 |
|
32 |
| -# Requirements: |
33 |
| -# python >= 3.6 |
34 |
| -from sys import argv, exit as sys_exit, stderr |
35 |
| - |
36 | 38 |
|
37 | 39 | def sort_alphabetical(original_items):
|
38 | 40 | items = original_items.split(",")
|
|
0 commit comments