The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
#!/usr/bin/perl
#
# This file is part of Config-Model-Xorg
#
# This software is Copyright (c) 2015 by Dominique Dumont.
#
# This is free software, licensed under:
#
#   The GNU Lesser General Public License, Version 2.1, February 1999
#

#    Copyright (c) 2009 Dominique Dumont.
#
#    This file is part of Config-Model-Xorg.
#
#    Config-Model is free software; you can redistribute it and/or
#    modify it under the terms of the GNU Lesser Public License as
#    published by the Free Software Foundation; either version 2.1 of
#    the License, or (at your option) any later version.
#
#    Config-Model is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#    Lesser Public License for more details.
#
#    You should have received a copy of the GNU Lesser Public License
#    along with Config-Model; if not, write to the Free Software
#    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
#    02110-1301 USA

use strict ;
use warnings ;

my @command = (qw/config-edit -model Xorg/, @ARGV) ;

# print "Calling @command\n";

exec(@command)
  or die "Cannot call config-edit: $!\nIs Config::Model installed ?\n";

__END__

=head1 NAME

config-edit-xorg - Edit data of /etc/X11/xorg.conf

=head1 SYNOPSIS

  # most users will want to run
  config-edit-xorg [options] [ commands  ... ]

  # if you don't have a X server
  config-edit-xorg -ui curses [options] [ commands  ... ]

  # if you don't like curses
  config-edit-xorg -ui shell [options] [ commands  ... ]

  # if you are a sys admin
  config-edit-xorg -ui none [options]  <command>  ... 

=head1 DESCRIPTION

This program will edit the configuration data contained in
F</etc/X11/xorg.conf>.

You can specify commands as arguments that will be run on the
configuration root before launching the UI. These command follow the
syntax defined in L<Config::Model::Loader>.

=head1 Options

=over

=item -ui

Specify the user interface type. 

=over

=item *

C<tk>: provides a Tk graphical interface (If L<Config::Model::TkUI> is
installed).

=item *

C<curses>: provides a curses user interface (If
L<Config::Model::CursesUI> is installed).

=item *

C<shell>: provides a shell like interface.  See L<Config::Model::TermUI>
for details.

=item *

C<none>: No UI provided. Only command line arguments are handled.

=back

=item -root_dir

Specify a new root directory where to read and write the configuration
files. By default F</> so F</etc/X11/xorg.conf> will be used.

=item -verbose

Be (very) verbose

=item -debug

Provide debug infos.

=item -trace

Provides a full stack trace when exiting on error.

=item -force-load

Load file even if error are found in data. Bad data are discarded

=back

=cut

=head1 CAVEATS

Original structure and comments of F</etc/X11/xorg.conf> are lost during
edition.

=head1 SUPPORT

For support, please check the following ressources:

=over

=item *

The config-model wiki: L<http://config-model.wiki.sourceforge.net/>

=item *

The config-model users mailing list:
L<http://lists.sourceforge.net/mailman/listinfo/config-model-users>

=back

=head1 AUTHOR

Dominique Dumont, ddumont at cpan dot org

=head1 SEE ALSO

L<config-edit>, L<Config::Model>

=cut