[sdk/kdesrc-build] /: doc: List --run in commonly used options

Andrew Shark null at kde.org
Tue Feb 20 21:29:24 GMT 2024


Git commit 19044150a44a2f7a18d89a1e74dbcc0b5f696c6e by Andrew Shark.
Committed on 20/02/2024 at 21:29.
Pushed by ashark into branch 'master'.

doc: List --run in commonly used options

Reference full documentation from --help. No need to keep yet another place of options listing.

M  +54   -42   doc/cmdline.docbook
M  +6    -69   modules/ksb/Cmdline.pm

https://invent.kde.org/sdk/kdesrc-build/-/commit/19044150a44a2f7a18d89a1e74dbcc0b5f696c6e

diff --git a/doc/cmdline.docbook b/doc/cmdline.docbook
index a3380279..0ad480d0 100644
--- a/doc/cmdline.docbook
+++ b/doc/cmdline.docbook
@@ -17,48 +17,6 @@ kdesrc-build will build all modules defined in its configuration file, in the
 order listed in that file (although this can be modified by various
 configuration file options).</para>
 
-<sect2 id="cmdline-usage-options">
-<title>Commonly used command line options</title>
-
-<para>The full list of command line options is given in <xref
-linkend="supported-cmdline-params"/>. The most-commonly used options
-include:</para>
-
-<variablelist>
-  <varlistentry>
-    <term><option>--pretend</option> (or <option>-p</option>)</term>
-    <listitem><para>This option causes &kdesrc-build; to indicate what actions
-    it would take, without actually really implementing them. This can be
-    useful to make sure that the modules you think you are building will
-    actually get built.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><option>--refresh-build</option></term>
-    <listitem><para>This option forces &kdesrc-build; to build the given
-    modules from an absolutely fresh start point. Any existing build directory
-    for that module is removed and it is rebuilt. This option is useful if you
-    have errors building a module, and sometimes is required when &Qt; or &kde;
-    libraries change.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><option>--no-src</option></term>
-    <listitem><para>This option skips the source update process. You might use
-    it if you have very recently updated the source code (perhaps you did it
-    manually or recently ran &kdesrc-build;) but still want to rebuild some
-    modules.</para></listitem>
-  </varlistentry>
-
-  <varlistentry>
-    <term><option>--no-build</option></term>
-    <listitem><para>This option is similar to <option>--no-src</option> above,
-    but this time the build process is skipped.</para></listitem>
-  </varlistentry>
-</variablelist>
-
-</sect2>
-
 <sect2 id="cmdline-usage-modules">
 <title>Specifying modules to build</title>
 
@@ -96,6 +54,60 @@ option before building a new module set to ensure it is only building the
 modules you want.</para>
 
 </sect2>
+
+<sect2 id="cmdline-commonly-used-options">
+    <title>Commonly used command line options</title>
+    
+    <variablelist>
+      <varlistentry>
+        <term><option>--pretend</option> (or <option>-p</option>)</term>
+        <listitem><para>This option causes &kdesrc-build; to indicate what actions
+          it would take, without actually really implementing them. This can be
+          useful to make sure that the modules you think you are building will
+          actually get built.</para></listitem>
+      </varlistentry>
+      
+      <varlistentry>
+        <term><option>--no-src</option></term>
+        <listitem><para>This option skips the source update process. You might use
+          it if you have very recently updated the source code (perhaps you did it
+          manually or recently ran &kdesrc-build;) but still want to rebuild some
+          modules.</para></listitem>
+      </varlistentry>
+      
+      <varlistentry>
+        <term><option>--no-include-dependencies</option> (or <option>-D</option>)</term>
+        <listitem><para>Only process the selected modules, skipping their dependencies.
+          Useful when you have changed only selected modules, and you are sure you
+          do not need to rebuild the others.</para></listitem>
+      </varlistentry>
+      
+      <varlistentry>
+        <term><option>--refresh-build</option> (or <option>-r</option>)</term>
+        <listitem><para>This option forces &kdesrc-build; to build the given
+          modules from an absolutely fresh start point. Any existing build directory
+          for that module is removed and it is rebuilt. This option is useful if you
+          have errors building a module, and sometimes is required when &Qt; or &kde;
+          libraries change.</para></listitem>
+      </varlistentry>
+      
+      <varlistentry>
+        <term><option>--resume-from</option> module</term>
+        <listitem><para>Skips modules until just before the given module, then operates as normal.
+          Useful when the previous build failed on specific module, you fixed it, and then you
+          want to continue the with building the rest of initial set of modules.</para></listitem>
+      </varlistentry>
+      
+      <varlistentry>
+        <term><option>--run</option> module</term>
+        <listitem><para>Launch the built application.</para></listitem>
+      </varlistentry>
+    </variablelist>
+  
+  <para>The full list of command line options is given in <xref
+  linkend="supported-cmdline-params"/>.</para>
+  
+  </sect2>
 </sect1>
 
 &supported-envvars;
diff --git a/modules/ksb/Cmdline.pm b/modules/ksb/Cmdline.pm
index cb1666e4..a935286a 100644
--- a/modules/ksb/Cmdline.pm
+++ b/modules/ksb/Cmdline.pm
@@ -323,77 +323,14 @@ sub _showVersionAndExit
 
 sub _showHelpAndExit
 {
-    # According to XDG spec, if $XDG_CONFIG_HOME is not set, then we should
-    # default to ~/.config
-    my $xdgConfigHome = $ENV{XDG_CONFIG_HOME} // "$ENV{HOME}/.config";
-    my $xdgConfigHomeShort = $xdgConfigHome =~ s/^$ENV{HOME}/~/r; # Replace $HOME with ~
-
-    my $pwd = $ENV{PWD};
-    my $pwdShort = $pwd =~ s/^$ENV{HOME}/~/r; # Replace $HOME with ~
-
-    my $scriptVersion = scriptVersion();
-
     say <<~DONE;
-        kdesrc-build $scriptVersion
-        Copyright (c) 2003 - 2023 Michael Pyne <mpyne\@kde.org> and others, and is
-        distributed under the terms of the GNU GPL v2.
-
-        This script automates the download, build, and install process for KDE software
-        using the latest available source code.
-
-        Configuration is controlled from "$pwdShort/kdesrc-buildrc" or
-        "$xdgConfigHomeShort/kdesrc-buildrc".
-        See kdesrc-buildrc-sample for an example.
-
-        Usage: \$ $0 [--options] [module names]
-            All configured modules are built if none are listed.
-
-        Important Options:
-            --pretend (or -p)      Don't actually take major actions, instead describe
-                                   what would be done.
-            --dependency-tree      Print out dependency information on the modules that
-                                   would be built, using a `tree` format. Very useful
-                                   for learning how modules relate to each other. May
-                                   generate a lot of output.
-            --no-src   (or -S)     Don't update source code, just build/install.
-            --src-only (or -s)     Only update the source code
-            --metadata-only        Only update dependency info and KDE project database
-            --refresh-build        Start the build from scratch.
-              (or -r)
-            --rc-file=<filename>   Read configuration from filename instead of default.
-            --initial-setup        Installs required system pkgs, and a base kdesrc-buildrc.
-
-            --resume-from=<pkg>    Skips modules until just before or after the given
-            --resume-after=<pkg>       package, then operates as normal.
-            --stop-before=<pkg>    Stops just before or after the given package is
-            --stop-after=<pkg>         reached.
-
-            --include-dependencies
-             -d                    Also builds KDE-based dependencies of given modules.
-              (This is enabled by default; use --no-include-dependencies or -D to disable)
-
-        More docs at https://docs.kde.org/?application=kdesrc-build
-            Supported configuration options: https://docs.kde.org/trunk5/en/kdesrc-build/kdesrc-build/conf-options-table.html
-            Supported cmdline options:       https://docs.kde.org/trunk5/en/kdesrc-build/kdesrc-build/cmdline.html
-        DONE
-
-    # Look for indications that this is the first run
-    my @possibleConfigPaths = ("./kdesrc-buildrc",
-                               "$xdgConfigHome/kdesrc-buildrc",
-                               "$ENV{HOME}/.kdesrc-buildrc");
-
-    if (!grep { -e $_ } (@possibleConfigPaths)) {
-        say <<~DONE;
-              **  **  **  **  **
-            It looks like kdesrc-build has not yet been setup. For easy setup, run:
-                $0 --initial-setup
-
-            This will run your system's
-            package manager to install required dependencies, and setup a kdesrc-buildrc
-            that can be edited from there.
-            DONE
-    }
+        This script automates the download, build, and install process for KDE software using the latest available source code.
 
+        Documentation at https://docs.kde.org/?application=kdesrc-build
+            Commonly used command line options:             https://docs.kde.org/trunk5/en/kdesrc-build/kdesrc-build/cmdline.html#cmdline-commonly-used-options
+            Supported command-line parameters:              https://docs.kde.org/trunk5/en/kdesrc-build/kdesrc-build/supported-cmdline-params.html
+            Table of available configuration options:       https://docs.kde.org/trunk5/en/kdesrc-build/kdesrc-build/conf-options-table.html
+        DONE
     exit;
 }
 


More information about the kde-doc-english mailing list