New xorriso-dd-target option -version

This commit is contained in:
Thomas Schmitt 2020-01-06 22:02:19 +01:00
parent 557e69ada1
commit 43d5804db3
4 changed files with 40 additions and 9 deletions

View File

@ -14,6 +14,10 @@
# if $no_xorriso_dd_target_run is empty. It implements what xdt_print_usage # if $no_xorriso_dd_target_run is empty. It implements what xdt_print_usage
# announces. # announces.
xdt_print_version() {
echo "xorriso-dd-target , version 1.5.3 , 2020.01.06.204949"
}
## This obtrusive setting shall make the script safe against exotic locales. ## This obtrusive setting shall make the script safe against exotic locales.
## Supposed to stabilize grep expression interpretation and error messages. ## Supposed to stabilize grep expression interpretation and error messages.
@ -135,6 +139,7 @@ xdt_print_usage() {
echo " -dummy -DO_WRITE even against the advice of" echo " -dummy -DO_WRITE even against the advice of"
echo " this program. This probably shows you ways to" echo " this program. This probably shows you ways to"
echo " shoot your own foot." echo " shoot your own foot."
echo " -version Print version text and then end the program."
echo " -help Print this text to stdout and then end the program." echo " -help Print this text to stdout and then end the program."
echo "Examples:" echo "Examples:"
echo " $0 -with_sudo -list_all" echo " $0 -with_sudo -list_all"
@ -219,6 +224,7 @@ xdt_reset_job() {
# Status # Status
xdt_sudo_cmd= xdt_sudo_cmd=
xdt_have_su_power= xdt_have_su_power=
xdt_end_after_setup=
return 0 return 0
} }
@ -319,9 +325,15 @@ xdt_arg_interpreter() {
elif test "X$xdt_i" = "X-no_pacifier" elif test "X$xdt_i" = "X-no_pacifier"
then then
xdt_no_pacifier=y xdt_no_pacifier=y
elif test "X$xdt_i" = "X-version"
then
xdt_print_version
xdt_end_after_setup=y
return 0
elif test "X$xdt_i" = "X-help" elif test "X$xdt_i" = "X-help"
then then
xdt_print_usage xdt_print_usage
xdt_end_after_setup=y
return 0 return 0
elif echo "X$xdt_i" | grep -v '^X-' >/dev/null elif echo "X$xdt_i" | grep -v '^X-' >/dev/null
then then
@ -865,6 +877,10 @@ xdt_main()
xdt_reset_job xdt_reset_job
xdt_arg_interpreter "$@" || return "$?" xdt_arg_interpreter "$@" || return "$?"
if test -n "$xdt_end_after_setup"
then
return 0
fi
if test -n "$xdt_do_plug_test" if test -n "$xdt_do_plug_test"
then then

View File

@ -507,6 +507,10 @@ If a single device name is given, do a run of \-dummy \-DO_WRITE even against
the advice of this program. This probably shows you ways to shoot your own the advice of this program. This probably shows you ways to shoot your own
foot. foot.
.TP .TP
\fB\-version\fR
Print the program name, version text, and timestamp to stdout and then end
the program.
.TP
\fB\-help\fR \fB\-help\fR
Print the help text to stdout and then end the program. Print the help text to stdout and then end the program.
.SH EXAMPLES .SH EXAMPLES

View File

@ -400,6 +400,9 @@ File: xorriso-dd-target.info, Node: Options, Next: Examples, Prev: Overview,
If a single device name is given, do a run of -dummy -DO_WRITE even If a single device name is given, do a run of -dummy -DO_WRITE even
against the advice of this program. This probably shows you ways against the advice of this program. This probably shows you ways
to shoot your own foot. to shoot your own foot.
-version
Print the program name, version text, and timestamp to stdout and
then end the program.
-help -help
Print the help text to stdout and then end the program. Print the help text to stdout and then end the program.
@ -484,7 +487,7 @@ File: xorriso-dd-target.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal
* -DO_WRITE write image file to device: Options. (line 48) * -DO_WRITE write image file to device: Options. (line 48)
* -dummy report but do not perform: Options. (line 59) * -dummy report but do not perform: Options. (line 59)
* -dummy_force show raw copy commands: Options. (line 61) * -dummy_force show raw copy commands: Options. (line 61)
* -help print help text to stdout: Options. (line 65) * -help print help text to stdout: Options. (line 68)
* -image_file set path of disk image file: Options. (line 45) * -image_file set path of disk image file: Options. (line 45)
* -list_all print list of disk devices: Options. (line 15) * -list_all print list of disk devices: Options. (line 15)
* -list_long print extra device info: Options. (line 18) * -list_long print extra device info: Options. (line 18)
@ -493,6 +496,7 @@ File: xorriso-dd-target.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal
* -min_size set size limit for device: Options. (line 29) * -min_size set size limit for device: Options. (line 29)
* -no_pacifier do not show dd progress: Options. (line 55) * -no_pacifier do not show dd progress: Options. (line 55)
* -plug_test detect target device plugging: Options. (line 7) * -plug_test detect target device plugging: Options. (line 7)
* -version print version text to stdout: Options. (line 65)
* -with_sudo run lsblk, umount, dd by sudo: Options. (line 38) * -with_sudo run lsblk, umount, dd by sudo: Options. (line 38)
* -with_vendor_model add drive info to advice: Options. (line 22) * -with_vendor_model add drive info to advice: Options. (line 22)
@ -514,7 +518,7 @@ File: xorriso-dd-target.info, Node: ConceptIdx, Next: Top, Prev: CommandIdx,
* disk image file, set path, -image_file: Options. (line 45) * disk image file, set path, -image_file: Options. (line 45)
* disk image file, write to device, -DO_WRITE: Options. (line 48) * disk image file, write to device, -DO_WRITE: Options. (line 48)
* Drive info, add to advice, -with_vendor_model: Options. (line 22) * Drive info, add to advice, -with_vendor_model: Options. (line 22)
* help text, print to stdout, -help: Options. (line 65) * help text, print to stdout, -help: Options. (line 68)
* ISO 9660, demand presence on target, -look_for_iso: Options. (line 33) * ISO 9660, demand presence on target, -look_for_iso: Options. (line 33)
* lsblk, umount, dd, run by sudo, -with_sudo: Options. (line 38) * lsblk, umount, dd, run by sudo, -with_sudo: Options. (line 38)
* only report, do not perform, -dummy: Options. (line 59) * only report, do not perform, -dummy: Options. (line 59)
@ -529,6 +533,7 @@ File: xorriso-dd-target.info, Node: ConceptIdx, Next: Top, Prev: CommandIdx,
* Use case, show commands for writing to a not advised device: Unwise. * Use case, show commands for writing to a not advised device: Unwise.
(line 6) (line 6)
* Use case, write image to an advised device: Dowrite. (line 6) * Use case, write image to an advised device: Dowrite. (line 6)
* version text, print to stdout, -version: Options. (line 65)
* xorriso-dd-target, options: Options. (line 6) * xorriso-dd-target, options: Options. (line 6)
@ -544,12 +549,12 @@ Node: Dowrite7954
Node: Unwise9097 Node: Unwise9097
Node: Reasons10637 Node: Reasons10637
Node: Options13218 Node: Options13218
Node: Examples16208 Node: Examples16315
Node: Files16381 Node: Files16488
Node: Seealso16539 Node: Seealso16646
Node: Bugreport16705 Node: Bugreport16812
Node: Legal17292 Node: Legal17399
Node: CommandIdx17996 Node: CommandIdx18103
Node: ConceptIdx19189 Node: ConceptIdx19369
 
End Tag Table End Tag Table

View File

@ -649,6 +649,12 @@ If a single device name is given, do a run of -dummy -DO_WRITE even against
the advice of this program. This probably shows you ways to shoot your own the advice of this program. This probably shows you ways to shoot your own
foot. foot.
@c man .TP @c man .TP
@item -version
@kindex -version print version text to stdout
@cindex version text, print to stdout, -version
Print the program name, version text, and timestamp to stdout and then end
the program.
@c man .TP
@item -help @item -help
@kindex -help print help text to stdout @kindex -help print help text to stdout
@cindex help text, print to stdout, -help @cindex help text, print to stdout, -help