Merge pull request #22980 from keszybz/test-help-and-version-output

Test --help and --version output in more cases
This commit is contained in:
Yu Watanabe
2022-04-06 13:42:12 +09:00
committed by GitHub
29 changed files with 150 additions and 78 deletions
+8 -6
View File
@@ -1075,9 +1075,8 @@ static int help(void) {
" -h --help Show this help\n"
" --version Show version\n"
" --test Determine initial transaction, dump it and exit\n"
" --system In combination with --test: operate as system service manager\n"
" --user In combination with --test: operate as per-user service manager\n"
" --no-pager Do not pipe output into a pager\n"
" --system Combined with --test: operate in system mode\n"
" --user Combined with --test: operate in user mode\n"
" --dump-configuration-items Dump understood unit configuration items\n"
" --dump-bus-properties Dump exposed bus properties\n"
" --bus-introspect=PATH Write XML introspection data\n"
@@ -1087,14 +1086,17 @@ static int help(void) {
" --crash-reboot[=BOOL] Reboot on crash\n"
" --crash-shell[=BOOL] Run shell on crash\n"
" --confirm-spawn[=BOOL] Ask for confirmation when spawning processes\n"
" --show-status[=BOOL] Show status updates on the console during bootup\n"
" --log-target=TARGET Set log target (console, journal, kmsg, journal-or-kmsg, null)\n"
" --log-level=LEVEL Set log level (debug, info, notice, warning, err, crit, alert, emerg)\n"
" --show-status[=BOOL] Show status updates on the console during boot\n"
" --log-target=TARGET Set log target (console, journal, kmsg,\n"
" journal-or-kmsg, null)\n"
" --log-level=LEVEL Set log level (debug, info, notice, warning,\n"
" err, crit, alert, emerg)\n"
" --log-color[=BOOL] Highlight important log messages\n"
" --log-location[=BOOL] Include code location in log messages\n"
" --log-time[=BOOL] Prefix log messages with current time\n"
" --default-standard-output= Set default standard output for services\n"
" --default-standard-error= Set default standard error output for services\n"
" --no-pager Do not pipe output into a pager\n"
"\nSee the %s for details.\n",
program_invocation_short_name,
ansi_highlight(),
+2 -2
View File
@@ -151,7 +151,7 @@ load_fragment_gperf_gperf = custom_target(
'load-fragment-gperf.gperf',
input : 'load-fragment-gperf.gperf.in',
output: 'load-fragment-gperf.gperf',
command : [meson_render_jinja2, config_h, '@INPUT@', '@OUTPUT@'])
command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'])
load_fragment_gperf_c = custom_target(
'load-fragment-gperf.c',
@@ -217,7 +217,7 @@ foreach item : in_files
file,
input : file + '.in',
output: file,
command : [meson_render_jinja2, config_h, '@INPUT@', '@OUTPUT@'],
command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
install : (dir == pkgsysconfdir) ? install_sysconfdir_samples : (dir != 'no'),
install_dir : dir)
endforeach
+31 -31
View File
@@ -984,37 +984,37 @@ static int help(void) {
printf("%s [OPTIONS...]\n\n"
"Configures basic settings of the system.\n\n"
" -h --help Show this help\n"
" --version Show package version\n"
" --root=PATH Operate on an alternate filesystem root\n"
" --image=PATH Operate on an alternate filesystem image\n"
" --locale=LOCALE Set primary locale (LANG=)\n"
" --locale-messages=LOCALE Set message locale (LC_MESSAGES=)\n"
" --keymap=KEYMAP Set keymap\n"
" --timezone=TIMEZONE Set timezone\n"
" --hostname=NAME Set hostname\n"
" --machine-ID=ID Set machine ID\n"
" --root-password=PASSWORD Set root password from plaintext password\n"
" --root-password-file=FILE Set root password from file\n"
" --root-password-hashed=HASHED_PASSWORD Set root password from hashed password\n"
" --root-shell=SHELL Set root shell\n"
" --prompt-locale Prompt the user for locale settings\n"
" --prompt-keymap Prompt the user for keymap settings\n"
" --prompt-timezone Prompt the user for timezone\n"
" --prompt-hostname Prompt the user for hostname\n"
" --prompt-root-password Prompt the user for root password\n"
" --prompt-root-shell Prompt the user for root shell\n"
" --prompt Prompt for all of the above\n"
" --copy-locale Copy locale from host\n"
" --copy-keymap Copy keymap from host\n"
" --copy-timezone Copy timezone from host\n"
" --copy-root-password Copy root password from host\n"
" --copy-root-shell Copy root shell from host\n"
" --copy Copy locale, keymap, timezone, root password\n"
" --setup-machine-id Generate a new random machine ID\n"
" --force Overwrite existing files\n"
" --delete-root-password Delete root password\n"
" --welcome=no Disable the welcome text\n"
" -h --help Show this help\n"
" --version Show package version\n"
" --root=PATH Operate on an alternate filesystem root\n"
" --image=PATH Operate on an alternate filesystem image\n"
" --locale=LOCALE Set primary locale (LANG=)\n"
" --locale-messages=LOCALE Set message locale (LC_MESSAGES=)\n"
" --keymap=KEYMAP Set keymap\n"
" --timezone=TIMEZONE Set timezone\n"
" --hostname=NAME Set hostname\n"
" --machine-ID=ID Set machine ID\n"
" --root-password=PASSWORD Set root password from plaintext password\n"
" --root-password-file=FILE Set root password from file\n"
" --root-password-hashed=HASH Set root password from hashed password\n"
" --root-shell=SHELL Set root shell\n"
" --prompt-locale Prompt the user for locale settings\n"
" --prompt-keymap Prompt the user for keymap settings\n"
" --prompt-timezone Prompt the user for timezone\n"
" --prompt-hostname Prompt the user for hostname\n"
" --prompt-root-password Prompt the user for root password\n"
" --prompt-root-shell Prompt the user for root shell\n"
" --prompt Prompt for all of the above\n"
" --copy-locale Copy locale from host\n"
" --copy-keymap Copy keymap from host\n"
" --copy-timezone Copy timezone from host\n"
" --copy-root-password Copy root password from host\n"
" --copy-root-shell Copy root shell from host\n"
" --copy Copy locale, keymap, timezone, root password\n"
" --setup-machine-id Generate a new random machine ID\n"
" --force Overwrite existing files\n"
" --delete-root-password Delete root password\n"
" --welcome=no Disable the welcome text\n"
"\nSee the %s for details.\n",
program_invocation_short_name,
link);
+1 -1
View File
@@ -54,7 +54,7 @@ foreach tuple : in_files
file,
input : file + '.in',
output: file,
command : [meson_render_jinja2, config_h, '@INPUT@', '@OUTPUT@'],
command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
install : tuple[1],
install_dir : pkgsysconfdir)
endforeach
@@ -23,11 +23,12 @@ skip_remaining=77
usage()
{
echo "Usage:"
echo " $0 [OPTIONS...] add KERNEL-VERSION KERNEL-IMAGE [INITRD-FILE ...]"
echo " $0 [OPTIONS...] remove KERNEL-VERSION"
echo " $0 [OPTIONS...] inspect"
echo " kernel-install [OPTIONS...] add KERNEL-VERSION KERNEL-IMAGE [INITRD-FILE...]"
echo " kernel-install [OPTIONS...] remove KERNEL-VERSION"
echo " kernel-install [OPTIONS...] inspect"
echo "Options:"
echo " -h, --help Print this help"
echo " -h, --help Print this help and exit"
echo " --version Print version string and exit"
echo " -v, --verbose Increase verbosity"
}
@@ -59,6 +60,13 @@ for i; do
fi
done
for i; do
if [ "$i" = "--version" ]; then
echo "kernel-install {{PROJECT_VERSION}} ({{GIT_VERSION}})"
exit 0
fi
done
export KERNEL_INSTALL_VERBOSE=0
if [ "$1" = "--verbose" ] || [ "$1" = "-v" ]; then
shift
+2 -4
View File
@@ -1,10 +1,8 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
if want_kernel_install
install_data('kernel-install',
install_mode : 'rwxr-xr-x',
install_dir : bindir)
kernel_install_in = files('kernel-install.in')
if want_kernel_install
install_data('50-depmod.install',
'90-loaderentry.install',
install_mode : 'rwxr-xr-x',
+1 -1
View File
@@ -186,7 +186,7 @@ custom_target(
'libsystemd.pc',
input : 'libsystemd.pc.in',
output : 'libsystemd.pc',
command : [meson_render_jinja2, config_h, '@INPUT@', '@OUTPUT@'],
command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
install : pkgconfiglibdir != 'no',
install_dir : pkgconfiglibdir)
+1 -1
View File
@@ -38,7 +38,7 @@ custom_target(
'libudev.pc',
input : 'libudev.pc.in',
output : 'libudev.pc',
command : [meson_render_jinja2, config_h, '@INPUT@', '@OUTPUT@'],
command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
install : pkgconfiglibdir != 'no',
install_dir : pkgconfiglibdir)
+1 -1
View File
@@ -80,7 +80,7 @@ foreach tuple : in_files
file,
input : file + '.in',
output: file,
command : [meson_render_jinja2, config_h, '@INPUT@', '@OUTPUT@'],
command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
install : tuple[2] and install,
install_dir : dir)
endforeach
+1 -1
View File
@@ -168,7 +168,7 @@ custom_target(
'resolved.conf',
input : 'resolved.conf.in',
output : 'resolved.conf',
command : [meson_render_jinja2, config_h, '@INPUT@', '@OUTPUT@'],
command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
install : conf.get('ENABLE_RESOLVE') == 1 and install_sysconfdir_samples,
install_dir : pkgsysconfdir)
+1 -1
View File
@@ -18,7 +18,7 @@ foreach tuple : in_files
file,
input : file + '.in',
output : file,
command : [meson_render_jinja2, config_h, '@INPUT@', '@OUTPUT@'],
command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
install : tuple[1],
install_dir : tuple.length() > 2 ? tuple[2] : '',
build_by_default : true)
+1 -1
View File
@@ -39,7 +39,7 @@ custom_target(
'timesyncd.conf',
input : 'timesyncd.conf.in',
output : 'timesyncd.conf',
command : [meson_render_jinja2, config_h, '@INPUT@', '@OUTPUT@'],
command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
install : conf.get('ENABLE_TIMESYNCD') == 1 and install_sysconfdir_samples,
install_dir : pkgsysconfdir)
+1 -1
View File
@@ -166,7 +166,7 @@ custom_target(
'udev.pc',
input : 'udev.pc.in',
output : 'udev.pc',
command : [meson_render_jinja2, config_h, '@INPUT@', '@OUTPUT@'],
command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
install : pkgconfigdatadir != 'no',
install_dir : pkgconfigdatadir)
+1 -1
View File
@@ -4,6 +4,6 @@ custom_target(
'90-vconsole.rules',
input : '90-vconsole.rules.in',
output : '90-vconsole.rules',
command : [meson_render_jinja2, config_h, '@INPUT@', '@OUTPUT@'],
command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
install : conf.get('ENABLE_VCONSOLE') == 1,
install_dir : udevrulesdir)