• Veronika Kabatova's avatar
    Extend the parser to accept negative options · f17b60ef
    Veronika Kabatova authored
    Introducing negative options for true / false values. The original
    getopt_long parser is kept since it is able to set flag-like values
    (instead of setting these values in the switch when it's not needed).
    The type of the options needed to be changed to integers for getopt_long
    to accept flag-like value settings (as per getopt_long documentation,
    the address of integer variable has to be passed).
    
    Corresponding negative options are not added for deprecated options.
    
    This patch is a preparation for the addition of configuration files
    (GitHub issue #278). General idea of this feature is to have global
    configuration files in /etc/criu.d/ directory and user-specific
    configuration files in $HOME/.criu.d/ directory, with the possibility
    of specifying a chosen file to be used (default files will be used if
    none is specified, or none in case the default ones are not present,
    to not break compatibility). The options in configuration files should
    be possible to be overriden by the options specified on command line,
    hence the negative options addition.
    
    The whole feature of configuration files will remove the need of
    specifying all the options on command line, with the possibility of
    reusing a file for different use case with only overriding some of the
    values specified there.
    
    In case both types of option (negative and positive) are passed, the
    later one will be applied -- this works with the philosophy of
    overriding the "earlier" options from configuration files.
    
    Changes since v1:
    - Describe the --no- option prefix in the beginning of OPTIONS section in
      both man page and --help instead of mentioning it at every eligible line
      (this also fixes line length issue with --help)
    - Fix the accidental removal of check_only case caused by bad rebase
    - Use a macro for getopt_long struct option generating instead of additional
      defines and hardcoded lines
    Signed-off-by: 's avatarVeronika Kabatova <vkabatov@redhat.com>
    Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
    f17b60ef
Name
Last commit
Last update
..
.gitattributes Loading commit data...
.gitignore Loading commit data...
HOWTO.cross-compile Loading commit data...
Makefile Loading commit data...
asciidoc.conf Loading commit data...
crit.txt Loading commit data...
criu.txt Loading commit data...
custom.xsl Loading commit data...