Lines Matching +full:shebang +full:- +full:command
3 # Change the #! line (shebang) occurring in Python scripts. The new interpreter
4 # pathname must be given with a -i option.
6 # Command line arguments are files or directories to be processed.
11 # The original file is kept as a back-up (with a "~" attached to its name),
12 # -n flag can be used to disable this.
14 # Sometimes you may find shebangs with flags such as `#! /usr/bin/env python -si`.
16 # To change interpreter and keep flags from the original shebang line, use -k.
17 # If you want to keep flags and add to them one single literal flag, use option -a.
53 usage = ('usage: %s -i /interpreter -p -n -k -a file-or-directory ...\n' %
62 if o == '-i':
64 if o == '-p':
66 if o == '-n':
68 if o == '-k':
70 if o == '-a':
73 err("-a option doesn't support whitespaces")
77 err('-i option or file-or-directory missing\n')
148 # Finishing touch -- move files
190 start = shebangline.find(b' -')
191 if start == -1:
206 # e.g. "#! /usr/bin/python3 -W Error -s" runs "/usr/bin/python3 "-W Error -s"
207 # so shebang should have single '-' where flags are given and
209 # between '-' and original flags
210 # e.g. #! /usr/bin/python3 -sW Error
211 return b' -' + add_flags + old_flags