The newly added 'check_root()' method introduced an interactive prompt
that would ask the user if they wanted to continue. The new argument '-y'
will now skip the prompt, so that if a user needs to run this script
un-interactively, they can do so easily.
def main():
- check_root()
os.chdir(SOURCE_ROOT)
args = parse_args()
+ if (args.yes is False and
+ sys.platform not in ('win32', 'cygwin')):
+ check_root()
if args.verbose:
enable_verbose_mode()
if sys.platform == 'cygwin':
parser.add_argument('-v', '--verbose',
action='store_true',
help='Prints the output of the subprocesses')
+ parser.add_argument('-y', '--yes', '--assume-yes',
+ action='store_true',
+ help='Run non-interactively by assuming "yes" to all ' \
+ 'prompts.')
return parser.parse_args()
def check_root():