mirror of
https://github.com/arkenfox/user.js.git
synced 2025-05-07 17:33:45 +02:00
Add backup option
This commit is contained in:
parent
d215dea5b0
commit
6b2c30b7cc
1 changed files with 5 additions and 3 deletions
|
@ -14,14 +14,14 @@
|
||||||
#
|
#
|
||||||
# Report bugs to https://github.com/ghacksuserjs/ghacks-user.js/issues
|
# Report bugs to https://github.com/ghacksuserjs/ghacks-user.js/issues
|
||||||
|
|
||||||
readonly VERSION="1.4"
|
readonly VERSION="2.0"
|
||||||
|
|
||||||
# Default values for flags.
|
# Default values for flags.
|
||||||
QUIET="false"
|
QUIET="false"
|
||||||
VERBOSE="false"
|
VERBOSE="false"
|
||||||
FORCE_VERSION="false"
|
FORCE_VERSION="false"
|
||||||
UPDATED="false"
|
UPDATED="false"
|
||||||
|
MAKE_BACKUP="false"
|
||||||
|
|
||||||
# Prints a message to the standard error and exit with error code 1.
|
# Prints a message to the standard error and exit with error code 1.
|
||||||
error() {
|
error() {
|
||||||
|
@ -68,12 +68,13 @@ show_help() {
|
||||||
cat <<-_EOF
|
cat <<-_EOF
|
||||||
Usage:
|
Usage:
|
||||||
$PROGRAM [--update,-u] [--verbose] [--quiet,-q] [--force-version,-f]
|
$PROGRAM [--update,-u] [--verbose] [--quiet,-q] [--force-version,-f]
|
||||||
[--help,-h] [--version,-v]
|
[--help,-h] [--version,-v] [--backup,-b]
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
-u, --update First updates the updater script, then the user.js
|
-u, --update First updates the updater script, then the user.js
|
||||||
--force-version, -f Force to download the user.js according to the
|
--force-version, -f Force to download the user.js according to the
|
||||||
Firefox version
|
Firefox version
|
||||||
|
--backup, -b Make a copy of the old user.js before overwriting it
|
||||||
--quiet, -q Print only errors
|
--quiet, -q Print only errors
|
||||||
--verbose Print additional informations
|
--verbose Print additional informations
|
||||||
--help Print this message
|
--help Print this message
|
||||||
|
@ -128,6 +129,7 @@ while :; do
|
||||||
--verbose) shift; VERBOSE="true";;
|
--verbose) shift; VERBOSE="true";;
|
||||||
--help|-h) shift; SHOW_HELP="true";;
|
--help|-h) shift; SHOW_HELP="true";;
|
||||||
--version|-v) shift; SHOW_VERSION="true";;
|
--version|-v) shift; SHOW_VERSION="true";;
|
||||||
|
--backup|-b) shift; MAKE_BACKUP="true";;
|
||||||
"") break;; # Default case: no more options.
|
"") break;; # Default case: no more options.
|
||||||
*) error "Unrecognized option '$1'";;
|
*) error "Unrecognized option '$1'";;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Add table
Reference in a new issue