Skip to content

Stop execution after displaying help message if user passed --help flag

Balasankar 'Balu' C requested to merge backup-utility-help-break into master

When user passes --help, they want just the help message. We should stop execution after that. Without this MR, the following happens


$ backup-utility --help

   Usage: backup-utility [--restore] [-f URL]

   optional arguments:
     -h, --help                             show this help message and exit
     --restore [-t TIMESTAMP | -f URL]      when specified utility restores from an existing backup specified
                                            as a url or a timestamp of an existing backup in object storage
WARNING: This version of GitLab depends on gitlab-shell 7.1.4, but you're running Unknown. Please update gitlab-shell.
Dumping database ... 
Dumping PostgreSQL database gitlabhq_production ... [DONE]
done
Dumping registry ...
Dumping uploads ...
done
Dumping artifacts ...
Dumping lfs ...
WARNING: This version of GitLab depends on gitlab-shell 7.1.4, but you're running Unknown. Please update gitlab-shell.
Packing up backup tar
WARNING: Module python-magic is not available. Guessing MIME types based on file extensions.

I expected it to just show the help message. It went ahead and created a backup file.

Merge request reports