summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-11-12 18:19:08 +0000
committerOlivier Blin <oblin@mandriva.com>2008-11-12 18:19:08 +0000
commit5d4910aa17a97f1257c04102c4a459c6c7a65f33 (patch)
tree90fb222a843525774b5f7fda8b984043f463cdd7 /bin
parent65152c1b3bf08dee653d4db63be591d0659d829f (diff)
downloaddrak3d-5d4910aa17a97f1257c04102c4a459c6c7a65f33.tar
drak3d-5d4910aa17a97f1257c04102c4a459c6c7a65f33.tar.gz
drak3d-5d4910aa17a97f1257c04102c4a459c6c7a65f33.tar.bz2
drak3d-5d4910aa17a97f1257c04102c4a459c6c7a65f33.tar.xz
drak3d-5d4910aa17a97f1257c04102c4a459c6c7a65f33.zip
check if system supports command line options before applying them
Diffstat (limited to 'bin')
-rwxr-xr-xbin/drak3d10
1 files changed, 8 insertions, 2 deletions
diff --git a/bin/drak3d b/bin/drak3d
index 1cb2f07..531ddb9 100755
--- a/bin/drak3d
+++ b/bin/drak3d
@@ -41,11 +41,17 @@ sub exit_program { $in ? $in->exit(@_) : exit(@_) }
my $glx = Xconfig::glx::detect_may_install($do_pkgs) or exit_program();
my $running_wm = any::running_window_manager();
+my $o_method;
+my $o_wm;
GetOptions(
- "method=s" => \$glx->{method},
- "wm=s" => \$glx->{wm},
+ "method=s" => \$o_method,
+ "wm=s" => \$o_wm,
) or warn "invalid options";
+my $use_arguments = !$o_method || $glx->{capabilities}{$o_method};
+$glx->{method} = $use_arguments && $o_method if $o_method;
+$glx->{wm} = $use_arguments && $o_wm if $o_wm;
+
my @advanced_settings = (
[ N_("A graphical server supporting OpenGL compositing should be selected."), 'methods', 'method', \@Xconfig::glx::gl_compositing_servers, 1 ],
[ N_("An OpenGL compositing window manager should be selected. It provides 3D desktop and compositing effects in window management, such as translucent windows and moving effects."), 'wms', 'wm', \@Xconfig::glx::gl_compositing_wms, 0 ],