Shlomi Fish avatar Shlomi Fish committed bd9cc9c

Correct the WriteConfig() with -delta documentation.

Thanks to the Mageia Linux QA team for detecting it.

Comments (0)

Files changed (2)

config-inifiles/Changes

+* Correct the documentation regarding the syntax of calling ->WriteConfig(),
+which always accepts a mandatory filename and not just
+"->WriteConfig(-delta => 1)".
+    - Thanks to the Mageia Linux QA team at:
+        - https://bugs.mageia.org/show_bug.cgi?id=6024#c17
+
 Version 2.75    ( Fri May 25 15:25:29 IDT 2012 )
 ------------------------------------------------
 

config-inifiles/lib/Config/IniFiles.pm

 If set to 0 (the default if not importing), these comments are treated
 like ordinary ones.
 
-The L</WriteConfig|WriteConfig(-delta=>1)> form will output such
+The L</WriteConfig|WriteConfig($filename, -delta=>1)> form will output such
 comments to indicate deleted sections or parameters. This way,
 reloading a delta file using the same imported object produces the
 same results in memory again. See L<IMPORT / DELTA FEATURES> for more
     $self->{mysects} = []; # A pair of hashes to remember which params are loaded
     $self->{myparms} = {}; # or set using the API vs. imported - useful for
     $self->{peCMT}  = {};  # this will store trailing comments at the end of single-lined params
-    # import shadowing, see below, and WriteConfig(-delta=>1)
+    # import shadowing, see below, and WriteConfig($fn, -delta=>1)
 
     if( defined $self->{imported} ) {
         # Run up the import tree to the top, then reload coming
 =head2 WriteConfig ($filename [, %options])
 
 Writes out a new copy of the configuration file.  A temporary file
-(ending in '-new') is written out and then renamed to the specified
-filename.  Also see B<BUGS> below.
+is written out and then renamed to the specified filename.  Also see
+B<BUGS> below.
 
 If C<-delta> is set to a true value in %options, and this object was
 imported from another (see L</new>), only the differences between this
 
    $overlay->setval("section1", "arg1", "anotherval");
    $overlay->newval("section3", "arg3", "val3");
-   $overlay->WriteConfig(-delta=>1);
+   $overlay->WriteConfig('overlay.ini', -delta=>1);
 
 C<overlay.ini> would now contain
 
 
    $overlay->DeleteSection("section2");
    $overlay->delval("section1", "arg0");
-   $overlay->WriteConfig(-delta=>1);
+   $overlay->WriteConfig('overlay.ini', -delta=>1);
 
 The I<overlay.ini> file would now read:
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.